[PATCH 1 of 2] bookmarks: rename arguments/variables for source code readability

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sat Sep 22 00:56:41 CDT 2012

# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1348293230 -32400
# Node ID 750be2c38db4e86c3f09d0cae83e9af9d49795e7
# Parent  331d611813eca2098fdb75c741cb7f5cc72b6567
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

In addition to it, "local"/"remote" seem to mean not the direction of
propagation of bookmarks, but just the location of cooperative

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"

diff -r 331d611813ec -r 750be2c38db4 mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Wed Sep 19 09:38:51 2012 -0700
+++ b/mercurial/bookmarks.py	Sat Sep 22 14:53:50 2012 +0900
@@ -237,15 +237,15 @@
     if changed:
-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:

More information about the Mercurial-devel mailing list