mercurial/cmdutil.py
branchstable
changeset 42163 e45c6b153e51
parent 42071 db72f9f6580e
child 42297 19b95afb0c01
--- a/mercurial/cmdutil.py	Fri May 03 20:06:03 2019 +0900
+++ b/mercurial/cmdutil.py	Mon May 06 22:10:34 2019 -0400
@@ -272,6 +272,15 @@
             raise error.Abort(_('cannot partially commit a merge '
                                '(use "hg commit" instead)'))
 
+        def fail(f, msg):
+            raise error.Abort('%s: %s' % (f, msg))
+
+        force = opts.get('force')
+        if not force:
+            vdirs = []
+            match.explicitdir = vdirs.append
+            match.bad = fail
+
         status = repo.status(match=match)
 
         overrides = {(b'ui', b'commitsubrepos'): True}
@@ -294,15 +303,6 @@
                     dirtyreason = wctx.sub(s).dirtyreason(True)
                     raise error.Abort(dirtyreason)
 
-        def fail(f, msg):
-            raise error.Abort('%s: %s' % (f, msg))
-
-        force = opts.get('force')
-        if not force:
-            vdirs = []
-            match.explicitdir = vdirs.append
-            match.bad = fail
-
         if not force:
             repo.checkcommitpatterns(wctx, vdirs, match, status, fail)
         diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True,