changeset 3682:20912eb2667d

reorder tests in prepush It's more useful to show the new branches message than the unsynced changes message.
author Matt Mackall <mpm@selenic.com>
date Sun, 19 Nov 2006 16:32:36 -0600
parents 05d877dfd33d
children b0fd43effdb3
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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: