Show More
@@ -3113,13 +3113,18 b' def buildcommittext(repo, ctx, subs, ext' | |||
|
3113 | 3113 | return b"\n".join(edittext) |
|
3114 | 3114 | |
|
3115 | 3115 | |
|
3116 | def commitstatus(repo, node, branch, bheads=None, opts=None): | |
|
3116 | def commitstatus(repo, node, branch, bheads=None, tip=None, opts=None): | |
|
3117 | 3117 | if opts is None: |
|
3118 | 3118 | opts = {} |
|
3119 | 3119 | ctx = repo[node] |
|
3120 | 3120 | parents = ctx.parents() |
|
3121 | 3121 | |
|
3122 | if ( | |
|
3122 | if tip is not None and repo.changelog.tip() == tip: | |
|
3123 | # avoid reporting something like "committed new head" when | |
|
3124 | # recommitting old changesets, and issue a helpful warning | |
|
3125 | # for most instances | |
|
3126 | repo.ui.warn(_("warning: commit already existed in the repository!\n")) | |
|
3127 | elif ( | |
|
3123 | 3128 | not opts.get(b'amend') |
|
3124 | 3129 | and bheads |
|
3125 | 3130 | and node not in bheads |
@@ -851,11 +851,14 b' def _dobackout(ui, repo, node=None, rev=' | |||
|
851 | 851 | message, opts.get(b'user'), opts.get(b'date'), match, editor=e |
|
852 | 852 | ) |
|
853 | 853 | |
|
854 | # save to detect changes | |
|
855 | tip = repo.changelog.tip() | |
|
856 | ||
|
854 | 857 | newnode = cmdutil.commit(ui, repo, commitfunc, [], opts) |
|
855 | 858 | if not newnode: |
|
856 | 859 | ui.status(_(b"nothing changed\n")) |
|
857 | 860 | return 1 |
|
858 | cmdutil.commitstatus(repo, newnode, branch, bheads) | |
|
861 | cmdutil.commitstatus(repo, newnode, branch, bheads, tip) | |
|
859 | 862 | |
|
860 | 863 | def nice(node): |
|
861 | 864 | return b'%d:%s' % (repo.changelog.rev(node), short(node)) |
@@ -2024,6 +2027,7 b' def _docommit(ui, repo, *pats, **opts):' | |||
|
2024 | 2027 | |
|
2025 | 2028 | branch = repo[None].branch() |
|
2026 | 2029 | bheads = repo.branchheads(branch) |
|
2030 | tip = repo.changelog.tip() | |
|
2027 | 2031 | |
|
2028 | 2032 | extra = {} |
|
2029 | 2033 | if opts.get(b'close_branch') or opts.get(b'force_close_branch'): |
@@ -2113,7 +2117,7 b' def _docommit(ui, repo, *pats, **opts):' | |||
|
2113 | 2117 | ui.status(_(b"nothing changed\n")) |
|
2114 | 2118 | return 1 |
|
2115 | 2119 | |
|
2116 | cmdutil.commitstatus(repo, node, branch, bheads, opts) | |
|
2120 | cmdutil.commitstatus(repo, node, branch, bheads, tip, opts) | |
|
2117 | 2121 | |
|
2118 | 2122 | if not ui.quiet and ui.configbool(b'commands', b'commit.post-status'): |
|
2119 | 2123 | status( |
@@ -819,5 +819,5 b' Ensure that backout out the same changes' | |||
|
819 | 819 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
820 | 820 | $ hg backout 2 |
|
821 | 821 | removing 3 |
|
822 | created new head | |
|
822 | warning: commit already existed in the repository! | |
|
823 | 823 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f |
@@ -1868,6 +1868,7 b' Verify naming of temporary files and tha' | |||
|
1868 | 1868 | $ hg update -q -C 1 |
|
1869 | 1869 | $ hg mv f f.txt |
|
1870 | 1870 | $ hg ci -qm "f.txt" |
|
1871 | warning: commit already existed in the repository! | |
|
1871 | 1872 | $ hg update -q -C 2 |
|
1872 | 1873 | $ hg merge -y -r tip --tool echo \ |
|
1873 | 1874 | > --config merge-tools.echo.args='$base $local $other $output' \ |
@@ -1010,7 +1010,7 b' draft:' | |||
|
1010 | 1010 | $ hg up -C 1 |
|
1011 | 1011 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
1012 | 1012 | $ mkcommit C |
|
1013 | created new head | |
|
1013 | warning: commit already existed in the repository! | |
|
1014 | 1014 | $ hg phase -r 2 |
|
1015 | 1015 | 2: public |
|
1016 | 1016 | |
@@ -1027,6 +1027,7 b' Same, but for secret:' | |||
|
1027 | 1027 | 7: draft |
|
1028 | 1028 | $ mkcommit F |
|
1029 | 1029 | test-debug-phase: new rev 8: x -> 2 |
|
1030 | warning: commit already existed in the repository! | |
|
1030 | 1031 | test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret |
|
1031 | 1032 | $ hg phase -r tip |
|
1032 | 1033 | 8: secret |
@@ -1037,7 +1038,7 b' But what about obsoleted changesets?' | |||
|
1037 | 1038 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1038 | 1039 | $ mkcommit H |
|
1039 | 1040 | test-debug-phase: new rev 5: x -> 2 |
|
1040 | created new head | |
|
1041 | warning: commit already existed in the repository! | |
|
1041 | 1042 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
|
1042 | 1043 | $ hg phase -r 5 |
|
1043 | 1044 | 5: secret |
@@ -204,5 +204,6 b'' | |||
|
204 | 204 | $ hg update -r '.^' -q |
|
205 | 205 | $ echo 1 > A |
|
206 | 206 | $ hg commit -m foo -A A |
|
207 | warning: commit already existed in the repository! | |
|
207 | 208 | $ hg log -r . -T '{node}\n' |
|
208 | 209 | 383ce605500277f879b7460a16ba620eb6930b7f |
@@ -405,8 +405,10 b' Rename a->b, then amend b->c, and workin' | |||
|
405 | 405 | $ hg co -q 0 |
|
406 | 406 | $ hg mv a b |
|
407 | 407 | $ hg ci -qm 'move to a b' |
|
408 | warning: commit already existed in the repository! | |
|
408 | 409 | $ hg mv b c |
|
409 | 410 | $ hg amend |
|
411 | warning: commit already existed in the repository! | |
|
410 | 412 | $ hg mv c d |
|
411 | 413 | $ hg unamend |
|
412 | 414 | $ hg st --copies --change . |
General Comments 0
You need to be logged in to leave comments.
Login now