зеркало из https://github.com/microsoft/git.git
remote-hg: update bookmarks when using a remote
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
b082b4f94f
Коммит
731ce6cf75
|
@ -356,6 +356,21 @@ def fixup_user(user):
|
|||
|
||||
return '%s <%s>' % (name, mail)
|
||||
|
||||
def updatebookmarks(repo, peer):
|
||||
remotemarks = peer.listkeys('bookmarks')
|
||||
localmarks = repo._bookmarks
|
||||
|
||||
if not remotemarks:
|
||||
return
|
||||
|
||||
for k, v in remotemarks.iteritems():
|
||||
localmarks[k] = hgbin(v)
|
||||
|
||||
if hasattr(localmarks, 'write'):
|
||||
localmarks.write()
|
||||
else:
|
||||
bookmarks.write(repo)
|
||||
|
||||
def get_repo(url, alias):
|
||||
global dirname, peer
|
||||
|
||||
|
@ -394,6 +409,8 @@ def get_repo(url, alias):
|
|||
die('Repository error')
|
||||
repo.pull(peer, heads=None, force=True)
|
||||
|
||||
updatebookmarks(repo, peer)
|
||||
|
||||
return repo
|
||||
|
||||
def rev_to_mark(rev):
|
||||
|
|
Загрузка…
Ссылка в новой задаче