# HG changeset patch # User tonfa@arakou.lan # Date 1130200905 25200 # Node ID bf109779f48bff62884b443d2bd132728caf448a # Parent 65cbe22b03fadb8c19e45a5a4ebb3853fa623b09 Fix relative pull in a subdir diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -591,7 +591,7 @@ def bundle(ui, repo, fname, dest="defaul contents including permissions, rename data, and revision history. """ f = open(fname, "wb") - dest = ui.expandpath(dest) + dest = ui.expandpath(dest, repo.root) other = hg.repository(ui, dest) o = repo.findoutgoing(other) cg = repo.changegroup(o) @@ -1380,7 +1380,7 @@ def incoming(ui, repo, source="default", Currently only local repositories are supported. """ - source = ui.expandpath(source) + source = ui.expandpath(source, repo.root) other = hg.repository(ui, source) if not other.local(): raise util.Abort(_("incoming doesn't work for remote repositories yet")) @@ -1549,7 +1549,7 @@ def outgoing(ui, repo, dest="default-pus default push repo. These are the changesets that would be pushed if a push was requested. """ - dest = ui.expandpath(dest) + dest = ui.expandpath(dest, repo.root) other = hg.repository(ui, dest) o = repo.findoutgoing(other) o = repo.newer(o) @@ -1625,7 +1625,7 @@ def pull(ui, repo, source="default", **o to the remote user's home directory by default; use two slashes at the start of a path to specify it as relative to the filesystem root. """ - source = ui.expandpath(source) + source = ui.expandpath(source, repo.root) ui.status(_('pulling from %s\n') % (source)) if opts['ssh']: @@ -1665,7 +1665,7 @@ def push(ui, repo, dest="default-push", SSH requires an accessible shell account on the destination machine and a copy of hg in the remote path. """ - dest = ui.expandpath(dest) + dest = ui.expandpath(dest, repo.root) ui.status('pushing to %s\n' % (dest)) if ssh: diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -89,9 +89,12 @@ class ui: user = user[f+1:] return user - def expandpath(self, loc): + def expandpath(self, loc, root=""): paths = {} for name, path in self.configitems("paths"): + m = path.find("://") + if m == -1: + path = os.path.join(root, path) paths[name] = path return paths.get(loc, loc)