reorder tests in prepush
authorMatt Mackall <mpm@selenic.com>
Sun, 19 Nov 2006 16:32:36 -0600
changeset 3682 20912eb2667d
parent 3681 05d877dfd33d
child 3683 b0fd43effdb3
reorder tests in prepush It's more useful to show the new branches message than the unsynced changes message.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Nov 19 17:01:59 2006 -0200
+++ b/mercurial/localrepo.py	Sun Nov 19 16:32:36 2006 -0600
@@ -1298,11 +1298,6 @@
         base = {}
         remote_heads = remote.heads()
         inc = self.findincoming(remote, base, remote_heads, force=force)
-        if not force and inc:
-            self.ui.warn(_("abort: unsynced remote changes!\n"))
-            self.ui.status(_("(did you forget to sync?"
-                             " use push -f to force)\n"))
-            return None, 1
 
         update, updated_heads = self.findoutgoing(remote, base, remote_heads)
         if revs is not None:
@@ -1323,6 +1318,12 @@
                                  " use push -f to force)\n"))
                 return None, 1
 
+        if not force and inc:
+            self.ui.warn(_("abort: unsynced remote changes!\n"))
+            self.ui.status(_("(did you forget to sync?"
+                             " use push -f to force)\n"))
+            return None, 1
+
         if revs is None:
             cg = self.changegroup(update, 'push')
         else: