changeset 24473:0142b59f5743

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()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 25 Mar 2015 13:55:35 +0900
parents 1bf71faf042e
children 61a99993f8a7
files mercurial/commands.py tests/test-update-branches.t
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Mar 25 13:55:35 2015 +0900
+++ b/mercurial/commands.py	Wed Mar 25 13:55:35 2015 +0900
@@ -6337,9 +6337,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()
 
--- a/tests/test-update-branches.t	Wed Mar 25 13:55:35 2015 +0900
+++ b/tests/test-update-branches.t	Wed Mar 25 13:55:35 2015 +0900
@@ -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