bookmarks: rename arguments/variables for source code readability
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 22 Sep 2012 14:53:50 +0900
changeset 17667 2b6a795f19f7
parent 17666 5b6c8f2fbda5
child 17668 28c43957f8b4
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"
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Thu Sep 27 13:54:47 2012 +0200
+++ b/mercurial/bookmarks.py	Sat Sep 22 14:53:50 2012 +0900
@@ -237,15 +237,15 @@
     if changed:
         write(repo)
 
-def diff(ui, repo, remote):
+def diff(ui, dst, src):
     ui.status(_("searching for changed bookmarks\n"))
 
-    lmarks = repo.listkeys('bookmarks')
-    rmarks = remote.listkeys('bookmarks')
+    smarks = src.listkeys('bookmarks')
+    dmarks = dst.listkeys('bookmarks')
 
-    diff = sorted(set(rmarks) - set(lmarks))
+    diff = sorted(set(smarks) - set(dmarks))
     for k in diff:
-        mark = ui.debugflag and rmarks[k] or rmarks[k][:12]
+        mark = ui.debugflag and smarks[k] or smarks[k][:12]
         ui.write("   %-25s %s\n" % (k, mark))
 
     if len(diff) <= 0: