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

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 13, 2015, 3:35 p.m.
Message ID <7cbefdfd926ca9c1bbd7.1426260901@feefifofum>
Download mbox | patch
Permalink /patch/8050/
State Superseded
Commit 0142b59f5743eff0c795377f49c0eb09067cf152
Headers show

Comments

Katsunori FUJIWARA - March 13, 2015, 3:35 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1426260651 -32400
#      Sat Mar 14 00:30:51 2015 +0900
# Node ID 7cbefdfd926ca9c1bbd7483c1361357f64fd6f27
# Parent  06060b1642b66ec9d123e265182dce0a5f0d7c7c
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
@@ -6259,9 +6259,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 subrepo sub
   parent=1
   M sub/suba