mercurial/commands.py
changeset 18997 4cf09a1bf5b2
parent 18996 160d8416e286
child 19025 3af92401efb3
--- a/mercurial/commands.py	Tue Apr 09 23:40:11 2013 +0900
+++ b/mercurial/commands.py	Tue Apr 09 23:40:11 2013 +0900
@@ -5464,6 +5464,7 @@
     if opts.get('remote'):
         t = []
         source, branches = hg.parseurl(ui.expandpath('default'))
+        sbranch = branches[0]
         other = hg.peer(repo, {}, source)
         revs, checkout = hg.addbranchrevs(repo, other, branches,
                                           opts.get('rev'))
@@ -5478,11 +5479,13 @@
             t.append(_('1 or more incoming'))
 
         dest, branches = hg.parseurl(ui.expandpath('default-push', 'default'))
+        dbranch = branches[0]
         revs, checkout = hg.addbranchrevs(repo, repo, branches, None)
         if source != dest:
             other = hg.peer(repo, {}, dest)
+            ui.debug('comparing with %s\n' % util.hidepassword(dest))
+        if (source != dest or (sbranch is not None and sbranch != dbranch)):
             commoninc = None
-            ui.debug('comparing with %s\n' % util.hidepassword(dest))
         if revs:
             revs = [repo.lookup(rev) for rev in revs]
         repo.ui.pushbuffer()