D6536: strip: move checksubstate() to mq (its only caller)

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Jun 17 18:40:34 EDT 2019


Closed by commit rHG4bcabb5ae9b6: strip: move checksubstate() to mq (its only caller) (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6536?vs=15550&id=15561

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6536/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6536

AFFECTED FILES
  hgext/mq.py
  hgext/strip.py

CHANGE DETAILS

diff --git a/hgext/strip.py b/hgext/strip.py
--- a/hgext/strip.py
+++ b/hgext/strip.py
@@ -31,21 +31,6 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
-def checksubstate(repo, baserev=None):
-    '''return list of subrepos at a different revision than substate.
-    Abort if any subrepos have uncommitted changes.'''
-    inclsubs = []
-    wctx = repo[None]
-    if baserev:
-        bctx = repo[baserev]
-    else:
-        bctx = wctx.p1()
-    for s in sorted(wctx.substate):
-        wctx.sub(s).bailifchanged(True)
-        if s not in bctx.substate or bctx.sub(s).dirty():
-            inclsubs.append(s)
-    return inclsubs
-
 def checklocalchanges(repo, force=False):
     cmdutil.checkunfinished(repo)
     s = repo.status()
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -144,7 +144,21 @@
     stripext = extensions.load(dummyui(), 'strip', '')
 
 strip = stripext.strip
-checksubstate = stripext.checksubstate
+
+def checksubstate(repo, baserev=None):
+    '''return list of subrepos at a different revision than substate.
+    Abort if any subrepos have uncommitted changes.'''
+    inclsubs = []
+    wctx = repo[None]
+    if baserev:
+        bctx = repo[baserev]
+    else:
+        bctx = wctx.p1()
+    for s in sorted(wctx.substate):
+        wctx.sub(s).bailifchanged(True)
+        if s not in bctx.substate or bctx.sub(s).dirty():
+            inclsubs.append(s)
+    return inclsubs
 
 # Patch names looks like unix-file names.
 # They must be joinable with queue directory and result in the patch path.



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list