update: check wc.dirty() before setting overwrite=True
authorAugie Fackler <durin42@gmail.com>
Fri, 17 Jun 2011 15:21:02 -0500
changeset 14663 88cb01c4575e
parent 14662 2b30124c7d8a
child 14664 0ae98cd2a83f
update: check wc.dirty() before setting overwrite=True merge.update() was missing a few dirtiness checks from workingcontext, including subrepo cleanliness checks. Using wc.dirty() instead of one-off checks for various forms of dirtiness will be significantly safer.
mercurial/merge.py
--- a/mercurial/merge.py	Thu Jun 16 15:26:17 2011 -0500
+++ b/mercurial/merge.py	Fri Jun 17 15:21:02 2011 -0500
@@ -525,7 +525,7 @@
         elif not overwrite:
             if pa == p1 or pa == p2: # linear
                 pass # all good
-            elif wc.files() or wc.deleted():
+            elif wc.dirty(missing=True):
                 raise util.Abort(_("crosses branches (merge branches or use"
                                    " --clean to discard changes)"))
             elif onode is None: