depth: fix compare mode for `debugdepth`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 17 Dec 2017 21:17:28 +0100
changeset 3299 c089495d7701
parent 3298 f4b06f44d274
child 3300 2d49773a378b
depth: fix compare mode for `debugdepth` The compare mode was broken for silly reasons.
hgext3rd/evolve/depthcache.py
--- a/hgext3rd/evolve/depthcache.py	Fri Dec 15 10:14:42 2017 +0100
+++ b/hgext3rd/evolve/depthcache.py	Sun Dec 17 21:17:28 2017 +0100
@@ -36,7 +36,7 @@
     """
     revs = scmutil.revrange(repo, opts['rev'])
     method = opts['method']
-    if method == 'cached':
+    if method in ('cached', 'compare'):
         cache = repo.depthcache
         cache.save(repo)
     for r in revs:
@@ -51,6 +51,7 @@
             if simple != cached:
                 raise error.Abort('depth differ for revision %s: %d != %d'
                                   % (ctx, simple, cached))
+            depth = simple
         else:
             raise error.Abort('unknown method "%s"' % method)
         ui.write('%s %d\n' % (ctx, depth))