Mercurial > hg
comparison mercurial/bookmarks.py @ 17667:2b6a795f19f7
bookmarks: rename arguments/variables for source code readability
Before this patch, the argument bound to the source repository of
incoming bookmarks for "bookmarks.diff()" is named as "remote".
But in "hg outgoing" case, this argument is bound to local repository
object.
In addition to it, "local"/"remote" seem to mean not the direction of
propagation of bookmarks, but just the location of cooperative
repositories.
To indicate the direction of propagation of bookmarks clearly on the
source code, this patch uses "d(st)" and "s(rc)" combination instead
of "l(ocal)" and "r(emote)" one.
- "repo" and "remote" arguments are renamed to "dst" and "src"
- "lmarks" and "rmarks" variables are renamed to "dmarsk" and "smarks"
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 22 Sep 2012 14:53:50 +0900 |
parents | 84f12b832ee8 |
children | b8424c92ba2b |
comparison
equal
deleted
inserted
replaced
17666:5b6c8f2fbda5 | 17667:2b6a795f19f7 |
---|---|
235 ui.status(_("adding remote bookmark %s\n") % k) | 235 ui.status(_("adding remote bookmark %s\n") % k) |
236 | 236 |
237 if changed: | 237 if changed: |
238 write(repo) | 238 write(repo) |
239 | 239 |
240 def diff(ui, repo, remote): | 240 def diff(ui, dst, src): |
241 ui.status(_("searching for changed bookmarks\n")) | 241 ui.status(_("searching for changed bookmarks\n")) |
242 | 242 |
243 lmarks = repo.listkeys('bookmarks') | 243 smarks = src.listkeys('bookmarks') |
244 rmarks = remote.listkeys('bookmarks') | 244 dmarks = dst.listkeys('bookmarks') |
245 | 245 |
246 diff = sorted(set(rmarks) - set(lmarks)) | 246 diff = sorted(set(smarks) - set(dmarks)) |
247 for k in diff: | 247 for k in diff: |
248 mark = ui.debugflag and rmarks[k] or rmarks[k][:12] | 248 mark = ui.debugflag and smarks[k] or smarks[k][:12] |
249 ui.write(" %-25s %s\n" % (k, mark)) | 249 ui.write(" %-25s %s\n" % (k, mark)) |
250 | 250 |
251 if len(diff) <= 0: | 251 if len(diff) <= 0: |
252 ui.status(_("no changed bookmarks found\n")) | 252 ui.status(_("no changed bookmarks found\n")) |
253 return 1 | 253 return 1 |