Show all unnamed heads at once

Co-Authored-By: ostan89@gmail.com
This commit is contained in:
Ethan Furman
2019-11-13 15:47:05 -08:00
committed by Ondrej Stanek
parent 597093eaf1
commit 2a9dd53d14

View File

@@ -497,16 +497,17 @@ def verify_heads(ui,repo,cache,force,branchesmap):
# verify that branch has exactly one head # verify that branch has exactly one head
t={} t={}
unnamed_heads=False
for h in repo.filtered(b'visible').heads(): for h in repo.filtered(b'visible').heads():
(_,_,_,_,_,_,branch,_)=get_changeset(ui,repo,h) (_,_,_,_,_,_,branch,_)=get_changeset(ui,repo,h)
if t.get(branch,False): if t.get(branch,False):
stderr_buffer.write( stderr_buffer.write(
b'Error: repository has at least one unnamed head: hg r%d\n' b'Error: repository has an unnamed head: hg r%d\n'
% repo.changelog.rev(h) % repo.changelog.rev(h)
) )
if not force: return False unnamed_heads=True
t[branch]=True t[branch]=True
if unnamed_heads and not force: return False
return True return True
def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile, def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile,