changeset 13453:c1b808020819 stable

bookmarks: issue a warning if remote doesn't support comparing bookmarks We want to issue a warning and abort comparing bookmarks if remote doesn't support it. Otherwise hg out -B will list you outgoing bookmarks that cannot be pushed to the remote repository using hg push -B.
author David Soria Parra <dsp@php.net>
date Mon, 21 Feb 2011 22:22:12 +0100
parents 3d3661df05e5
children afc84a879ac8
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Feb 21 11:24:23 2011 -0600
+++ b/mercurial/commands.py	Mon Feb 21 22:22:12 2011 +0100
@@ -2502,6 +2502,9 @@
         source, branches = hg.parseurl(ui.expandpath(source),
                                        opts.get('branch'))
         other = hg.repository(hg.remoteui(repo, opts), source)
+        if 'bookmarks' not in other.listkeys('namespaces'):
+            ui.warn(_("remote doesn't support bookmarks\n"))
+            return 0
         ui.status(_('comparing with %s\n') % url.hidepassword(source))
         return bookmarks.diff(ui, repo, other)
 
@@ -2786,6 +2789,9 @@
         dest = ui.expandpath(dest or 'default-push', dest or 'default')
         dest, branches = hg.parseurl(dest, opts.get('branch'))
         other = hg.repository(hg.remoteui(repo, opts), dest)
+        if 'bookmarks' not in other.listkeys('namespaces'):
+            ui.warn(_("remote doesn't support bookmarks\n"))
+            return 0
         ui.status(_('comparing with %s\n') % url.hidepassword(dest))
         return bookmarks.diff(ui, other, repo)