diff mercurial/localrepo.py @ 1674:dee55c4a4963

abort when using 'update -m' and this is not a merge add more testcases for updating with local changes
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 01 Feb 2006 08:46:24 +0100
parents daff3ef0de8d
children c21b54f7f7b8
line wrap: on
line diff
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1399,6 +1399,13 @@ class localrepository(object):
 
         modified, added, removed, deleted, unknown = self.changes()
 
+        # is this a jump, or a merge?  i.e. is there a linear path
+        # from p1 to p2?
+        linear_path = (pa == p1 or pa == p2)
+
+        if allow and linear_path:
+            raise util.Abort(_("there is nothing to merge, "
+                               "just use 'hg update'"))
         if allow and not forcemerge:
             if modified or added or removed:
                 raise util.Abort(_("outstanding uncommited changes"))
@@ -1411,10 +1418,6 @@ class localrepository(object):
                         raise util.Abort(_("'%s' already exists in the working"
                                            " dir and differs from remote") % f)
 
-        # is this a jump, or a merge?  i.e. is there a linear path
-        # from p1 to p2?
-        linear_path = (pa == p1 or pa == p2)
-
         # resolve the manifest to determine which files
         # we care about merging
         self.ui.note(_("resolving manifests\n"))