546 """ |
546 """ |
547 def commitfunc(ui, repo, files, message, match, opts): |
547 def commitfunc(ui, repo, files, message, match, 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): |
557 """mark files as copied for the next commit |
566 """mark files as copied for the next commit |
558 |
567 |