Skip to content
Snippets Groups Projects
Commit affd1195 authored by David M. Carr's avatar David M. Carr
Browse files

peer: pass localrepo to new gitrepo instances

This change wraps hg.peer to allow for capturing the repo object.  It is then
passed in to new gitrepo instanceds.  This will be needed to implement later
functionality, such as richer bookmark support using pushkeys.
parent 06a29fdd
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,14 @@
# 1.7+
pass
def peer(orig, uiorrepo, *args, **opts):
newpeer = orig(uiorrepo, *args, **opts)
if isinstance(newpeer, gitrepo.gitrepo):
if isinstance(uiorrepo, localrepo.localrepository):
newpeer.localrepo = uiorrepo
return newpeer
extensions.wrapfunction(hg, 'peer', peer)
def revset_fromgit(repo, subset, x):
'''``fromgit()``
Select changesets that originate from Git.
......
......@@ -22,6 +22,7 @@
raise util.Abort('Cannot create a git repository.')
self.ui = ui
self.path = path
self.localrepo = None
def url(self):
return self.path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment