diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-05-24 21:29:38 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-28 07:59:56 -0700 |
commit | 731ce6cf75d304bc14c1ee0ad45e5846f5db6834 (patch) | |
tree | 6020f93c6d81fad83638147855f68a154754ecc1 | |
parent | b082b4f94ff1a82ce42223f7a46c9423e99c48e9 (diff) | |
download | git-731ce6cf75d304bc14c1ee0ad45e5846f5db6834.tar.gz git-731ce6cf75d304bc14c1ee0ad45e5846f5db6834.tar.xz |
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>
-rwxr-xr-x | contrib/remote-helpers/git-remote-hg | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 7c859b82e..76438a687 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -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): |