зеркало из https://github.com/microsoft/git.git
remote-hg: fake bookmark when there's none
Or at least no current bookmark. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
Родитель
9490bd04fe
Коммит
46cc3adb60
|
@ -26,7 +26,7 @@ import urllib
|
||||||
# git:
|
# git:
|
||||||
# Sensible defaults for git.
|
# Sensible defaults for git.
|
||||||
# hg bookmarks are exported as git branches, hg branches are prefixed
|
# hg bookmarks are exported as git branches, hg branches are prefixed
|
||||||
# with 'branches/'.
|
# with 'branches/', HEAD is a special case.
|
||||||
#
|
#
|
||||||
# hg:
|
# hg:
|
||||||
# Emulate hg-git.
|
# Emulate hg-git.
|
||||||
|
@ -430,12 +430,21 @@ def get_branch_tip(repo, branch):
|
||||||
return heads[0]
|
return heads[0]
|
||||||
|
|
||||||
def list_head(repo, cur):
|
def list_head(repo, cur):
|
||||||
global g_head
|
global g_head, bmarks
|
||||||
|
|
||||||
head = bookmarks.readcurrent(repo)
|
head = bookmarks.readcurrent(repo)
|
||||||
if not head:
|
if head:
|
||||||
return
|
node = repo[head]
|
||||||
node = repo[head]
|
else:
|
||||||
|
# fake bookmark from current branch
|
||||||
|
head = cur
|
||||||
|
node = repo['.']
|
||||||
|
if not node:
|
||||||
|
return
|
||||||
|
if head == 'default':
|
||||||
|
head = 'master'
|
||||||
|
bmarks[head] = node
|
||||||
|
|
||||||
print "@refs/heads/%s HEAD" % head
|
print "@refs/heads/%s HEAD" % head
|
||||||
g_head = (head, node)
|
g_head = (head, node)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче