diff -r 57875cf423c9 -r 2372284d9457 mercurial/logexchange.py --- a/mercurial/logexchange.py Sat Oct 05 10:29:34 2019 -0400 +++ b/mercurial/logexchange.py Sun Oct 06 09:45:02 2019 -0400 @@ -18,6 +18,7 @@ # directory name in .hg/ in which remotenames files will be present remotenamedir = 'logexchange' + def readremotenamefile(repo, filename): """ reads a file from .hg/logexchange/ directory and yields it's content @@ -45,6 +46,7 @@ f.close() + def readremotenames(repo): """ read the details about the remotenames stored in .hg/logexchange/ and @@ -58,6 +60,7 @@ for branchentry in readremotenamefile(repo, 'branches'): yield branchentry + def writeremotenamefile(repo, remotepath, names, nametype): vfs = vfsmod.vfs(repo.vfs.join(remotenamedir)) f = vfs(nametype, 'w', atomictemp=True) @@ -81,6 +84,7 @@ f.close() + def saveremotenames(repo, remotepath, branches=None, bookmarks=None): """ save remotenames i.e. remotebookmarks and remotebranches in their @@ -95,6 +99,7 @@ finally: wlock.release() + def activepath(repo, remote): """returns remote path""" # is the remote a local peer @@ -123,6 +128,7 @@ return rpath + def pullremotenames(localrepo, remoterepo): """ pulls bookmarks and branches information of the remote repo during a @@ -133,9 +139,9 @@ remotepath = activepath(localrepo, remoterepo) with remoterepo.commandexecutor() as e: - bookmarks = e.callcommand('listkeys', { - 'namespace': 'bookmarks', - }).result() + bookmarks = e.callcommand( + 'listkeys', {'namespace': 'bookmarks',} + ).result() # on a push, we don't want to keep obsolete heads since # they won't show up as heads on the next pull, so we