File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import urllib
26
26
# git:
27
27
# Sensible defaults for git.
28
28
# hg bookmarks are exported as git branches, hg branches are prefixed
29
- # with 'branches/'.
29
+ # with 'branches/', HEAD is a special case .
30
30
#
31
31
# hg:
32
32
# Emulate hg-git.
@@ -430,12 +430,21 @@ def get_branch_tip(repo, branch):
430
430
return heads [0 ]
431
431
432
432
def list_head (repo , cur ):
433
- global g_head
433
+ global g_head , bmarks
434
434
435
435
head = bookmarks .readcurrent (repo )
436
- if not head :
437
- return
438
- node = repo [head ]
436
+ if head :
437
+ node = repo [head ]
438
+ else :
439
+ # fake bookmark from current branch
440
+ head = cur
441
+ node = repo ['.' ]
442
+ if not node :
443
+ return
444
+ if head == 'default' :
445
+ head = 'master'
446
+ bmarks [head ] = node
447
+
439
448
print "@refs/heads/%s HEAD" % head
440
449
g_head = (head , node )
441
450
You can’t perform that action at this time.
0 commit comments