changeset 14554:68db17047637

hg: add peer method
author Matt Mackall <mpm@selenic.com>
date Fri, 10 Jun 2011 11:43:38 -0500
parents d976542986d2
children 1ceb2cf9f9d9
files mercurial/fileset.py mercurial/hg.py
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Wed Jun 08 18:24:33 2011 +0200
+++ b/mercurial/fileset.py	Fri Jun 10 11:43:38 2011 -0500
@@ -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 = {
--- a/mercurial/hg.py	Wed Jun 08 18:24:33 2011 +0200
+++ b/mercurial/hg.py	Fri Jun 10 11:43:38 2011 -0500
@@ -98,6 +98,11 @@
             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))