[PATCH] push/outgoing: print remote target path even if there's an error (issue2561)

Miloš Hadžić milos.hadzic at gmail.com
Thu Mar 17 16:58:12 CDT 2011


# HG changeset patch
# User Miloš Hadžić <milos.hadzic at gmail.com>
# Date 1300398902 -3600
# Node ID 0a488f6edb0c9242d9534eedb43803816fa75b90
# Parent  d16c99f16f00d68ca79e3a383335bc866a8c409f
push/outgoing: print remote target path even if there's an error (issue2561)

This is a simple patch to make hg push/hg outgoing print their remote target
path even if the operation fails. I'm not sure if the original behavior was by
design.

This patch also changes one test to reflect the changed behaviour.

diff -r d16c99f16f00 -r 0a488f6edb0c mercurial/commands.py
--- a/mercurial/commands.py	Mon Mar 14 23:03:56 2011 +0100
+++ b/mercurial/commands.py	Thu Mar 17 22:55:02 2011 +0100
@@ -3039,9 +3039,9 @@
 
     dest = ui.expandpath(dest or 'default-push', dest or 'default')
     dest, branches = hg.parseurl(dest, opts.get('branch'))
+    ui.status(_('pushing to %s\n') % url.hidepassword(dest))
     revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
     other = hg.repository(hg.remoteui(repo, opts), dest)
-    ui.status(_('pushing to %s\n') % url.hidepassword(dest))
     if revs:
         revs = [repo.lookup(rev) for rev in revs]
 
diff -r d16c99f16f00 -r 0a488f6edb0c mercurial/hg.py
--- a/mercurial/hg.py	Mon Mar 14 23:03:56 2011 +0100
+++ b/mercurial/hg.py	Thu Mar 17 22:55:02 2011 +0100
@@ -487,12 +487,12 @@
 def _outgoing(ui, repo, dest, opts):
     dest = ui.expandpath(dest or 'default-push', dest or 'default')
     dest, branches = parseurl(dest, opts.get('branch'))
+    ui.status(_('comparing with %s\n') % url.hidepassword(dest))
     revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
     if revs:
         revs = [repo.lookup(rev) for rev in revs]
 
     other = repository(remoteui(repo, opts), dest)
-    ui.status(_('comparing with %s\n') % url.hidepassword(dest))
     o = discovery.findoutgoing(repo, other, force=opts.get('force'))
     if not o:
         ui.status(_("no changes found\n"))
diff -r d16c99f16f00 -r 0a488f6edb0c tests/test-ssh.t
--- a/tests/test-ssh.t	Mon Mar 14 23:03:56 2011 +0100
+++ b/tests/test-ssh.t	Thu Mar 17 22:55:02 2011 +0100
@@ -282,6 +282,7 @@
 passwords in ssh urls are not supported
 
   $ hg push ssh://user:erroneouspwd@dummy/remote
+  pushing to ssh://user:***@dummy/remote
   abort: password in URL not supported!
   [255]
 


More information about the Mercurial-devel mailing list