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

login
register
mail settings
Submitter Sean Farley
Date May 19, 2014, 8:32 p.m.
Message ID <3fd24754f34c5358e7cd.1400531530@laptop.local>
Download mbox | patch
Permalink /patch/4805/
State Accepted
Commit 4944c488f738e42a76a913f9c14d15b9cbce42a9
Headers show

Comments

Sean Farley - May 19, 2014, 8:32 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@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.

Patch

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)