923 lockmod.release(tr, lock, wlock) |
923 lockmod.release(tr, lock, wlock) |
924 |
924 |
925 @eh.command( |
925 @eh.command( |
926 '^split', |
926 '^split', |
927 [('r', 'rev', [], _("revision to split")), |
927 [('r', 'rev', [], _("revision to split")), |
|
928 ('n', 'note', '', _("store a note on split")), |
928 ] + commitopts + commitopts2 + commitopts3, |
929 ] + commitopts + commitopts2 + commitopts3, |
929 _('hg split [OPTION]... [-r] REV')) |
930 _('hg split [OPTION]... [-r] REV')) |
930 def cmdsplit(ui, repo, *revs, **opts): |
931 def cmdsplit(ui, repo, *revs, **opts): |
931 """split a changeset into smaller changesets |
932 """split a changeset into smaller changesets |
932 |
933 |
933 By default, split the current revision by prompting for all its hunks to be |
934 By default, split the current revision by prompting for all its hunks to be |
934 redistributed into new changesets. |
935 redistributed into new changesets. |
935 |
936 |
936 Use --rev to split a given changeset instead. |
937 Use --rev to split a given changeset instead. |
937 """ |
938 """ |
|
939 _checknotesize(opts) |
938 _resolveoptions(ui, opts) |
940 _resolveoptions(ui, opts) |
939 tr = wlock = lock = None |
941 tr = wlock = lock = None |
940 newcommits = [] |
942 newcommits = [] |
941 |
943 |
942 revarg = (list(revs) + opts.get('rev')) or ['.'] |
944 revarg = (list(revs) + opts.get('rev')) or ['.'] |
994 if newcommits: |
996 if newcommits: |
995 tip = repo[newcommits[-1]] |
997 tip = repo[newcommits[-1]] |
996 bmupdate(tip.node()) |
998 bmupdate(tip.node()) |
997 if bookactive is not None: |
999 if bookactive is not None: |
998 bookmarksmod.activate(repo, bookactive) |
1000 bookmarksmod.activate(repo, bookactive) |
999 obsolete.createmarkers(repo, [(repo[rev], newcommits)]) |
1001 metadata = {} |
|
1002 if opts.get('note'): |
|
1003 metadata['note'] = opts['note'] |
|
1004 obsolete.createmarkers(repo, [(repo[rev], newcommits)], |
|
1005 metadata=metadata) |
1000 tr.close() |
1006 tr.close() |
1001 finally: |
1007 finally: |
1002 lockmod.release(tr, lock, wlock) |
1008 lockmod.release(tr, lock, wlock) |
1003 |
1009 |
1004 @eh.command( |
1010 @eh.command( |