Patchwork [01,of,10,V8] bookmarks: rename listbookmarks() to listhexbookmarks()

login
register
mail settings
Submitter Stanislau Hlebik
Date Nov. 12, 2016, 8:19 p.m.
Message ID <fe9e78883230a875ae7a.1478981991@dev1918.lla1.facebook.com>
Download mbox | patch
Permalink /patch/17516/
State Superseded
Headers show

Comments

Stanislau Hlebik - Nov. 12, 2016, 8:19 p.m.
# HG changeset patch
# User Stanislau Hlebik <stash@fb.com>
# Date 1478980476 28800
#      Sat Nov 12 11:54:36 2016 -0800
# Branch stable
# Node ID fe9e78883230a875ae7acf6c7a5b324c1d9016f5
# Parent  b9f7b0c10027764cee77f9c6d61877fcffea837f
bookmarks: rename listbookmarks() to listhexbookmarks()

`listbookmarks()` returns hex nodes. Let's make it explicit because we'll need
function that returns bookmarks with binary nodes later.

Patch

diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -648,7 +648,7 @@ 
             return None
 
     def getbookmarks(self):
-        return bookmarks.listbookmarks(self.repo)
+        return bookmarks.listhexbookmarks(self.repo)
 
     def checkrevformat(self, revstr, mapname='splicemap'):
         """ Mercurial, revision string is a 40 byte hex """
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -284,7 +284,7 @@ 
             lockmod.release(tr, lock)
     return update
 
-def listbookmarks(repo):
+def listhexbookmarks(repo):
     # We may try to list bookmarks on a repo type that does not
     # support it (e.g., statichttprepository).
     marks = getattr(repo, '_bookmarks', {})
diff --git a/mercurial/pushkey.py b/mercurial/pushkey.py
--- a/mercurial/pushkey.py
+++ b/mercurial/pushkey.py
@@ -23,7 +23,8 @@ 
     return n
 
 _namespaces = {"namespaces": (lambda *x: False, _nslist),
-               "bookmarks": (bookmarks.pushbookmark, bookmarks.listbookmarks),
+               "bookmarks": (bookmarks.pushbookmark,
+                             bookmarks.listhexbookmarks),
                "phases": (phases.pushphase, phases.listphases),
                "obsolete": (obsolete.pushmarker, obsolete.listmarkers),
               }