# HG changeset patch # User Matt Mackall # Date 2011-06-10 16:43:38 # Node ID 68db17047637409bb3cef9d083b8c41097bf4f0d # Parent d976542986d2a2c46a989ff1318311ee8621738e hg: add peer method diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import parser, error, match +import parser, error from i18n import _ elements = { diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -98,6 +98,11 @@ def repository(ui, path='', create=False hook(ui, repo) return repo +def peer(ui, opts, path, create=False): + '''return a repository peer for the specified path''' + rui = remoteui(ui, opts) + return repository(rui, path, create) + def defaultdest(source): '''return default destination of clone if none is given''' return os.path.basename(os.path.normpath(source))