Mercurial > hg
diff mercurial/bookmarks.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 9acbe30953e8 |
children | 6266d19556ad |
line wrap: on
line diff
--- 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)