mercurial/bookmarks.py
changeset 45942 89a2afe31e82
parent 45913 9acbe30953e8
child 46780 6266d19556ad
--- a/mercurial/bookmarks.py	Fri Nov 27 17:00:00 2020 -0500
+++ b/mercurial/bookmarks.py	Fri Nov 27 17:03:29 2020 -0500
@@ -189,8 +189,7 @@
         return self._nodemap.get(node, [])
 
     def applychanges(self, repo, tr, changes):
-        """Apply a list of changes to bookmarks
-        """
+        """Apply a list of changes to bookmarks"""
         bmchanges = tr.changes.get(b'bookmarks')
         for name, node in changes:
             old = self._refmap.get(name)
@@ -422,8 +421,8 @@
 
 
 def calculateupdate(ui, repo):
-    '''Return a tuple (activemark, movemarkfrom) indicating the active bookmark
-    and where to move the active bookmark from, if needed.'''
+    """Return a tuple (activemark, movemarkfrom) indicating the active bookmark
+    and where to move the active bookmark from, if needed."""
     checkout, movemarkfrom = None, None
     activemark = repo._activebookmark
     if isactivewdirparent(repo):
@@ -509,7 +508,7 @@
 
 
 def comparebookmarks(repo, srcmarks, dstmarks, targets=None):
-    '''Compare bookmarks between srcmarks and dstmarks
+    """Compare bookmarks between srcmarks and dstmarks
 
     This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
     differ, invalid)", each are list of bookmarks below:
@@ -532,7 +531,7 @@
 
     If "targets" is specified, only bookmarks listed in it are
     examined.
-    '''
+    """
 
     if targets:
         bset = set(targets)
@@ -585,14 +584,14 @@
 
 
 def _diverge(ui, b, path, localmarks, remotenode):
-    '''Return appropriate diverged bookmark for specified ``path``
+    """Return appropriate diverged bookmark for specified ``path``
 
     This returns None, if it is failed to assign any divergent
     bookmark name.
 
     This reuses already existing one with "@number" suffix, if it
     refers ``remotenode``.
-    '''
+    """
     if b == b'@':
         b = b''
     # try to use an @pathalias suffix
@@ -762,13 +761,17 @@
 
 
 def incoming(ui, repo, peer):
-    '''Show bookmarks incoming from other to repo
-    '''
+    """Show bookmarks incoming from other to repo"""
     ui.status(_(b"searching for changed bookmarks\n"))
 
     with peer.commandexecutor() as e:
         remotemarks = unhexlifybookmarks(
-            e.callcommand(b'listkeys', {b'namespace': b'bookmarks',}).result()
+            e.callcommand(
+                b'listkeys',
+                {
+                    b'namespace': b'bookmarks',
+                },
+            ).result()
         )
 
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)
@@ -813,8 +816,7 @@
 
 
 def outgoing(ui, repo, other):
-    '''Show bookmarks outgoing from repo to other
-    '''
+    """Show bookmarks outgoing from repo to other"""
     ui.status(_(b"searching for changed bookmarks\n"))
 
     remotemarks = unhexlifybookmarks(other.listkeys(b'bookmarks'))
@@ -863,13 +865,18 @@
 
 
 def summary(repo, peer):
-    '''Compare bookmarks between repo and other for "hg summary" output
+    """Compare bookmarks between repo and other for "hg summary" output
 
     This returns "(# of incoming, # of outgoing)" tuple.
-    '''
+    """
     with peer.commandexecutor() as e:
         remotemarks = unhexlifybookmarks(
-            e.callcommand(b'listkeys', {b'namespace': b'bookmarks',}).result()
+            e.callcommand(
+                b'listkeys',
+                {
+                    b'namespace': b'bookmarks',
+                },
+            ).result()
         )
 
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)