Patchwork [2,of,5] obsolete: pass cache argument of successors set explicitly

login
register
mail settings
Submitter Boris Feld
Date July 5, 2017, 8:53 p.m.
Message ID <c3e21d634b02d567eb11.1499288035@FB>
Download mbox | patch
Permalink /patch/22020/
State Accepted
Headers show

Comments

Boris Feld - July 5, 2017, 8:53 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498827739 -7200
#      Fri Jun 30 15:02:19 2017 +0200
# Node ID c3e21d634b02d567eb113c2115ff096d9a73ef37
# Parent  9c95b4124cda97b0e257ff1a828053c5eb2014a5
# EXP-Topic successorstemplate
obsolete: pass cache argument of successors set explicitly

We plan to add a new argument to successorsets. But first we need to update
all callers to pass cache argument explicitly to avoid arguments confusion.

Patch

diff -r 9c95b4124cda -r c3e21d634b02 mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Fri Jun 30 13:47:24 2017 +0200
+++ b/mercurial/debugcommands.py	Fri Jun 30 15:02:19 2017 +0200
@@ -2111,7 +2111,7 @@ 
     for rev in scmutil.revrange(repo, revs):
         ctx = repo[rev]
         ui.write('%s\n'% ctx2str(ctx))
-        for succsset in obsutil.successorssets(repo, ctx.node(), cache):
+        for succsset in obsutil.successorssets(repo, ctx.node(), cache=cache):
             if succsset:
                 ui.write('    ')
                 ui.write(node2str(succsset[0]))
diff -r 9c95b4124cda -r c3e21d634b02 mercurial/obsolete.py
--- a/mercurial/obsolete.py	Fri Jun 30 13:47:24 2017 +0200
+++ b/mercurial/obsolete.py	Fri Jun 30 15:02:19 2017 +0200
@@ -955,7 +955,7 @@ 
                 continue # emergency cycle hanging prevention
             seen.add(prec)
             if prec not in newermap:
-                obsutil.successorssets(repo, prec, newermap)
+                obsutil.successorssets(repo, prec, cache=newermap)
             newer = [n for n in newermap[prec] if n]
             if len(newer) > 1:
                 divergent.add(ctx.rev())