Patchwork [4,of,5,V2] update: replace workingctx.dirty and raising Abort by cmdutil.bailifchanged

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 25, 2015, 4:59 a.m.
Message ID <6dee2b8e772fba83501a.1427259548@feefifofum>
Download mbox | patch
Permalink /patch/8253/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - March 25, 2015, 4:59 a.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1427259335 -32400
#      Wed Mar 25 13:55:35 2015 +0900
# Node ID 6dee2b8e772fba83501a3219fbdfbe985efd5830
# Parent  d294ac09229af96b4f8fe5fd0198d83912672962
update: replace workingctx.dirty and raising Abort by cmdutil.bailifchanged

This patch makes wrapping "commands.update()" by largefiles extension
useless, because "cmdutil.bailifchanged()" can detect changes of
largefiles in the working directory.

This patch also changes test-update-branches.t, because
"cmdutil.bailifchanged()" shows more detailed information about
dirty-ness of the working directory than "workingctx.dirty()".

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6329,9 +6329,7 @@ 
         rev = cmdutil.finddate(ui, repo, date)
 
     if check:
-        c = repo[None]
-        if c.dirty(merge=False, branch=False, missing=True):
-            raise util.Abort(_("uncommitted changes"))
+        cmdutil.bailifchanged(repo, merge=False)
         if rev is None:
             rev = repo[repo[None].branch()].rev()
 
diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -161,7 +161,7 @@ 
   M foo
 
   $ revtest '-c dirtysub linear'   dirtysub 1 2 -c
-  abort: uncommitted changes
+  abort: uncommitted changes in subrepository 'sub'
   parent=1
   M sub/suba