[PATCH 03 of 12] localrepo: use new subrev method of context.py

Sean Farley sean.michael.farley at gmail.com
Mon May 19 15:32:10 CDT 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1379732374 18000
#      Fri Sep 20 21:59:34 2013 -0500
# Node ID 3fd24754f34c5358e7cd9d1d8d72a59e6c9ae47b
# Parent  64ca202b3adb047775a7c1af627b375e2431d8c3
localrepo: use new subrev method of context.py

With the machinery in place, we use context.subrev instead of testing for a
workingctx directly. This allows more flexibility for later patches that will
add memctx to the mix.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1554,14 +1554,11 @@ class localrepository(object):
             # back added files (r[1]) and removed files (r[2])
             r[1], r[2] = r[2], r[1]
 
         if listsubrepos:
             for subpath, sub in scmutil.itersubrepos(ctx1, ctx2):
-                if working:
-                    rev2 = None
-                else:
-                    rev2 = ctx2.substate[subpath][1]
+                rev2 = ctx2.subrev(subpath)
                 try:
                     submatch = matchmod.narrowmatcher(subpath, match)
                     s = sub.status(rev2, match=submatch, ignored=listignored,
                                    clean=listclean, unknown=listunknown,
                                    listsubrepos=True)


More information about the Mercurial-devel mailing list