##// END OF EJS Templates
Avoid calling heads() twice on every hg commit....
Alexis S. L. Carvalho -
r6369:53912d30 default
parent child Browse files
Show More
@@ -548,9 +548,18 b' def commit(ui, repo, *pats, **opts):'
548 return repo.commit(files, message, opts['user'], opts['date'], match,
548 return repo.commit(files, message, opts['user'], opts['date'], match,
549 force_editor=opts.get('force_editor'))
549 force_editor=opts.get('force_editor'))
550
550
551 heads = repo.changelog.heads()
551 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
552 cmdutil.commit(ui, repo, commitfunc, pats, opts)
552 if not node:
553 if len(repo.changelog.heads()) > len(heads):
553 return
554 cl = repo.changelog
555 rev = cl.rev(node)
556 parents = cl.parentrevs(rev)
557 if rev - 1 in parents:
558 # one of the parents was the old tip
559 return
560 if (parents == (nullrev, nullrev) or
561 len(cl.heads(cl.node(parents[0]))) > 1 and
562 (parents[1] == nullrev or len(cl.heads(cl.node(parents[1]))) > 1)):
554 ui.status(_('created new head\n'))
563 ui.status(_('created new head\n'))
555
564
556 def copy(ui, repo, *pats, **opts):
565 def copy(ui, repo, *pats, **opts):
General Comments 0
You need to be logged in to leave comments. Login now