coreos/etcd — pull request #1521 by anguslees (2014-10-30 05:04:00+00:00)
Title: exec-watch: Fake "set" operations for existing keys

exec-watch --synthesize-set will now create fake "set" operations for
existing keys, before going into the regular watch cycle.

The etcd index from the initial lookup is passed through to the watch,
so no operations will be missed between the two REST calls.

Previously any existing key/values had to be dealt with separately, and
after-index had to be tracked carefully to avoid races and missing data
between the two. This change allows a single exec-watch command to act
on both the existing keys and any future changes with minimal additional
effort.