Show More
@@ -905,27 +905,32 b' def _pushcheckoutgoing(pushop):' | |||||
905 | # if repo.obsstore == False --> no obsolete |
|
905 | # if repo.obsstore == False --> no obsolete | |
906 | # then, save the iteration |
|
906 | # then, save the iteration | |
907 | if unfi.obsstore: |
|
907 | if unfi.obsstore: | |
908 | # this message are here for 80 char limit reason |
|
908 | obsoletes = [] | |
909 | mso = _(b"push includes obsolete changeset: %s!") |
|
909 | unstables = [] | |
910 | mspd = _(b"push includes phase-divergent changeset: %s!") |
|
910 | for node in outgoing.missing: | |
911 | mscd = _(b"push includes content-divergent changeset: %s!") |
|
|||
912 | mst = { |
|
|||
913 | b"orphan": _(b"push includes orphan changeset: %s!"), |
|
|||
914 | b"phase-divergent": mspd, |
|
|||
915 | b"content-divergent": mscd, |
|
|||
916 | } |
|
|||
917 | # If we are to push if there is at least one |
|
|||
918 | # obsolete or unstable changeset in missing, at |
|
|||
919 | # least one of the missinghead will be obsolete or |
|
|||
920 | # unstable. So checking heads only is ok |
|
|||
921 | for node in outgoing.ancestorsof: |
|
|||
922 | ctx = unfi[node] |
|
911 | ctx = unfi[node] | |
923 | if ctx.obsolete(): |
|
912 | if ctx.obsolete(): | |
924 |
|
|
913 | obsoletes.append(ctx) | |
925 | elif ctx.isunstable(): |
|
914 | elif ctx.isunstable(): | |
926 | # TODO print more than one instability in the abort |
|
915 | unstables.append(ctx) | |
927 | # message |
|
916 | if obsoletes or unstables: | |
928 | raise error.Abort(mst[ctx.instabilities()[0]] % ctx) |
|
917 | msg = b"" | |
|
918 | if obsoletes: | |||
|
919 | msg += _(b"push includes obsolete changesets:\n") | |||
|
920 | msg += b"\n".join(b' %s' % ctx for ctx in obsoletes) | |||
|
921 | if unstables: | |||
|
922 | if msg: | |||
|
923 | msg += b"\n" | |||
|
924 | msg += _(b"push includes unstable changesets:\n") | |||
|
925 | msg += b"\n".join( | |||
|
926 | b' %s (%s)' | |||
|
927 | % ( | |||
|
928 | ctx, | |||
|
929 | b", ".join(_(ins) for ins in ctx.instabilities()), | |||
|
930 | ) | |||
|
931 | for ctx in unstables | |||
|
932 | ) | |||
|
933 | raise error.Abort(msg) | |||
929 |
|
934 | |||
930 | discovery.checkheads(pushop) |
|
935 | discovery.checkheads(pushop) | |
931 | return True |
|
936 | return True |
@@ -118,7 +118,9 b' check that mercurial refuse to push' | |||||
118 | $ hg push ../other |
|
118 | $ hg push ../other | |
119 | pushing to ../other |
|
119 | pushing to ../other | |
120 | searching for changes |
|
120 | searching for changes | |
121 |
abort: push includes |
|
121 | abort: push includes unstable changesets: | |
|
122 | 82623d38b9ba (content-divergent) | |||
|
123 | 392fd25390da (content-divergent) | |||
122 | [255] |
|
124 | [255] | |
123 |
|
125 | |||
124 | $ cd .. |
|
126 | $ cd .. |
@@ -251,7 +251,8 b" And that we can't push bumped changeset" | |||||
251 | $ hg push ../tmpa |
|
251 | $ hg push ../tmpa | |
252 | pushing to ../tmpa |
|
252 | pushing to ../tmpa | |
253 | searching for changes |
|
253 | searching for changes | |
254 |
abort: push includes |
|
254 | abort: push includes unstable changesets: | |
|
255 | 5601fb93a350 (phase-divergent) | |||
255 | [255] |
|
256 | [255] | |
256 |
|
257 | |||
257 | Fixing "bumped" situation |
|
258 | Fixing "bumped" situation | |
@@ -616,7 +617,8 b' refuse to push obsolete changeset' | |||||
616 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
617 | $ hg push ../tmpc/ -r 'desc("original_d")' | |
617 | pushing to ../tmpc/ |
|
618 | pushing to ../tmpc/ | |
618 | searching for changes |
|
619 | searching for changes | |
619 |
abort: push includes obsolete changeset: |
|
620 | abort: push includes obsolete changesets: | |
|
621 | 94b33453f93b | |||
620 | [255] |
|
622 | [255] | |
621 |
|
623 | |||
622 | refuse to push unstable changeset |
|
624 | refuse to push unstable changeset | |
@@ -624,7 +626,10 b' refuse to push unstable changeset' | |||||
624 | $ hg push ../tmpc/ |
|
626 | $ hg push ../tmpc/ | |
625 | pushing to ../tmpc/ |
|
627 | pushing to ../tmpc/ | |
626 | searching for changes |
|
628 | searching for changes | |
627 |
abort: push includes o |
|
629 | abort: push includes obsolete changesets: | |
|
630 | 94b33453f93b | |||
|
631 | push includes unstable changesets: | |||
|
632 | cda648ca50f5 (orphan) | |||
628 | [255] |
|
633 | [255] | |
629 |
|
634 | |||
630 | with --force it will work anyway |
|
635 | with --force it will work anyway | |
@@ -647,6 +652,26 b' if the orphan changeset is already on th' | |||||
647 | no changes found |
|
652 | no changes found | |
648 | [1] |
|
653 | [1] | |
649 |
|
654 | |||
|
655 | pushing should work even if the outgoing changes contain an unrelated changeset | |||
|
656 | (neither obsolete nor unstable) (issue6372) | |||
|
657 | ||||
|
658 | $ hg up 1 -q | |||
|
659 | $ hg branch new -q | |||
|
660 | $ mkcommit c | |||
|
661 | ||||
|
662 | $ hg push ../tmpc/ --new-branch | |||
|
663 | pushing to ../tmpc/ | |||
|
664 | searching for changes | |||
|
665 | adding changesets | |||
|
666 | adding manifests | |||
|
667 | adding file changes | |||
|
668 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
669 | ||||
|
670 | make later tests work unmodified | |||
|
671 | ||||
|
672 | $ hg --config extensions.strip= strip tip -q | |||
|
673 | $ hg up 5 -q | |||
|
674 | ||||
650 | Test that extinct changeset are properly detected |
|
675 | Test that extinct changeset are properly detected | |
651 |
|
676 | |||
652 | $ hg log -r 'extinct()' |
|
677 | $ hg log -r 'extinct()' | |
@@ -1196,6 +1221,14 b' test whyunstable template keyword' | |||||
1196 | phase-divergent: immutable predecessor 245b |
|
1221 | phase-divergent: immutable predecessor 245b | |
1197 | content-divergent: predecessor 245b |
|
1222 | content-divergent: predecessor 245b | |
1198 |
|
1223 | |||
|
1224 | $ hg push ../tmpf -r 50c51b361e60 | |||
|
1225 | pushing to ../tmpf | |||
|
1226 | searching for changes | |||
|
1227 | abort: push includes unstable changesets: | |||
|
1228 | 50c51b361e60 (orphan, phase-divergent, content-divergent) | |||
|
1229 | [255] | |||
|
1230 | ||||
|
1231 | ||||
1199 | #if serve |
|
1232 | #if serve | |
1200 |
|
1233 | |||
1201 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
1234 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
General Comments 0
You need to be logged in to leave comments.
Login now