# HG changeset patch
# User Stanislau Hlebik <st...@fb.com>
# Date 1479807211 28800
#      Tue Nov 22 01:33:31 2016 -0800
# Node ID 0fd97a0c043a3f5c1d4ba050435d86e09dbd0f54
# Parent  d184b91890ae3cbd21f656847b6b2728892b2425
bookmarks: rename `compare()` to `comparebookmarks()` (API)

Next commit will remove optional parameters from `compare()` function.
Let's rename `compare()` to `comparebookmarks()` to avoid ambiguity from
callers from external extensions.

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -391,8 +391,8 @@
     finally:
         lockmod.release(tr, l, w)
 
-def compare(repo, srcmarks, dstmarks,
-            srchex=None, dsthex=None, targets=None):
+def comparebookmarks(repo, srcmarks, dstmarks,
+                     srchex=None, dsthex=None, targets=None):
     '''Compare bookmarks between srcmarks and dstmarks
 
     This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
@@ -511,7 +511,7 @@
     ui.debug("checking for updated bookmarks\n")
     localmarks = repo._bookmarks
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same
-     ) = compare(repo, remotemarks, localmarks, dsthex=hex)
+     ) = comparebookmarks(repo, remotemarks, localmarks, dsthex=hex)
 
     status = ui.status
     warn = ui.warn
@@ -573,8 +573,8 @@
     '''
     ui.status(_("searching for changed bookmarks\n"))
 
-    r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
-                dsthex=hex)
+    r = comparebookmarks(repo, other.listkeys('bookmarks'), repo._bookmarks,
+                         dsthex=hex)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
 
     incomings = []
@@ -615,8 +615,8 @@
     '''
     ui.status(_("searching for changed bookmarks\n"))
 
-    r = compare(repo, repo._bookmarks, other.listkeys('bookmarks'),
-                srchex=hex)
+    r = comparebookmarks(repo, repo._bookmarks, other.listkeys('bookmarks'),
+                         srchex=hex)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
 
     outgoings = []
@@ -660,8 +660,8 @@
 
     This returns "(# of incoming, # of outgoing)" tuple.
     '''
-    r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
-                dsthex=hex)
+    r = comparebookmarks(repo, other.listkeys('bookmarks'), repo._bookmarks,
+                         dsthex=hex)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
     return (len(addsrc), len(adddst))
 
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -603,7 +603,8 @@
     explicit = set([repo._bookmarks.expandname(bookmark)
                     for bookmark in pushop.bookmarks])
 
-    comp = bookmod.compare(repo, repo._bookmarks, remotebookmark, srchex=hex)
+    comp = bookmod.comparebookmarks(repo, repo._bookmarks,
+                                    remotebookmark, srchex=hex)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = comp
     for b, scid, dcid in advsrc:
         if b in explicit:
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to