# HG changeset patch # User Vadim Gelfer # Date 1151111384 25200 # Node ID 73ac956717888789eaa7c918b69d5bf241499245 # Parent 9c660e691e905210f3beaa1cde1f690fde66064a push, outgoing, bundle: fall back to "default" if "default-push" not defined diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -845,7 +845,7 @@ def backout(ui, repo, rev, **opts): 'do not forget to merge\n')) ui.status(_('(use "backout -m" if you want to auto-merge)\n')) -def bundle(ui, repo, fname, dest="default-push", **opts): +def bundle(ui, repo, fname, dest=None, **opts): """create a changegroup file Generate a compressed changegroup file collecting all changesets @@ -860,7 +860,7 @@ def bundle(ui, repo, fname, dest="defaul Unlike import/export, this exactly preserves all changeset contents including permissions, rename data, and revision history. """ - dest = ui.expandpath(dest) + dest = ui.expandpath(dest or 'default-push', dest or 'default') other = hg.repository(ui, dest) o = repo.findoutgoing(other, force=opts['force']) cg = repo.changegroup(o, 'bundle') @@ -2047,7 +2047,7 @@ def merge(ui, repo, node=None, **opts): """ return doupdate(ui, repo, node=node, merge=True, **opts) -def outgoing(ui, repo, dest="default-push", **opts): +def outgoing(ui, repo, dest=None, **opts): """show changesets not found in destination Show changesets not found in the specified destination repository or @@ -2056,7 +2056,7 @@ def outgoing(ui, repo, dest="default-pus See pull for valid destination format details. """ - dest = ui.expandpath(dest) + dest = ui.expandpath(dest or 'default-push', dest or 'default') if opts['ssh']: ui.setconfig("ui", "ssh", opts['ssh']) if opts['remotecmd']: @@ -2179,7 +2179,7 @@ def pull(ui, repo, source="default", **o modheads = repo.pull(other, heads=revs, force=opts['force']) return postincoming(ui, repo, modheads, opts['update']) -def push(ui, repo, dest="default-push", **opts): +def push(ui, repo, dest=None, **opts): """push changes to the specified destination Push changes from the local repository to the given destination. @@ -2201,7 +2201,7 @@ def push(ui, repo, dest="default-push", Look at the help text for the pull command for important details about ssh:// URLs. """ - dest = ui.expandpath(dest) + dest = ui.expandpath(dest or 'default-push', dest or 'default') if opts['ssh']: ui.setconfig("ui", "ssh", opts['ssh']) diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -197,12 +197,12 @@ class ui(object): if not self.verbose: user = util.shortuser(user) return user - def expandpath(self, loc): + def expandpath(self, loc, default=None): """Return repository location relative to cwd or from [paths]""" if loc.find("://") != -1 or os.path.exists(loc): return loc - return self.config("paths", loc, loc) + return self.config("paths", loc, default or loc) def write(self, *args): if self.header: