Show More
@@ -905,27 +905,32 b' def _pushcheckoutgoing(pushop):' | |||
|
905 | 905 | # if repo.obsstore == False --> no obsolete |
|
906 | 906 | # then, save the iteration |
|
907 | 907 | if unfi.obsstore: |
|
908 | # this message are here for 80 char limit reason | |
|
909 | mso = _(b"push includes obsolete changeset: %s!") | |
|
910 | mspd = _(b"push includes phase-divergent changeset: %s!") | |
|
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: | |
|
908 | obsoletes = [] | |
|
909 | unstables = [] | |
|
910 | for node in outgoing.missing: | |
|
922 | 911 | ctx = unfi[node] |
|
923 | 912 | if ctx.obsolete(): |
|
924 |
|
|
|
913 | obsoletes.append(ctx) | |
|
925 | 914 | elif ctx.isunstable(): |
|
926 | # TODO print more than one instability in the abort | |
|
927 | # message | |
|
928 | raise error.Abort(mst[ctx.instabilities()[0]] % ctx) | |
|
915 | unstables.append(ctx) | |
|
916 | if obsoletes or unstables: | |
|
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 | 935 | discovery.checkheads(pushop) |
|
931 | 936 | return True |
@@ -118,7 +118,9 b' check that mercurial refuse to push' | |||
|
118 | 118 | $ hg push ../other |
|
119 | 119 | pushing to ../other |
|
120 | 120 | searching for changes |
|
121 |
abort: push includes |
|
|
121 | abort: push includes unstable changesets: | |
|
122 | 82623d38b9ba (content-divergent) | |
|
123 | 392fd25390da (content-divergent) | |
|
122 | 124 | [255] |
|
123 | 125 | |
|
124 | 126 | $ cd .. |
@@ -251,7 +251,8 b" And that we can't push bumped changeset" | |||
|
251 | 251 | $ hg push ../tmpa |
|
252 | 252 | pushing to ../tmpa |
|
253 | 253 | searching for changes |
|
254 |
abort: push includes |
|
|
254 | abort: push includes unstable changesets: | |
|
255 | 5601fb93a350 (phase-divergent) | |
|
255 | 256 | [255] |
|
256 | 257 | |
|
257 | 258 | Fixing "bumped" situation |
@@ -616,7 +617,8 b' refuse to push obsolete changeset' | |||
|
616 | 617 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
617 | 618 | pushing to ../tmpc/ |
|
618 | 619 | searching for changes |
|
619 |
abort: push includes obsolete changeset: |
|
|
620 | abort: push includes obsolete changesets: | |
|
621 | 94b33453f93b | |
|
620 | 622 | [255] |
|
621 | 623 | |
|
622 | 624 | refuse to push unstable changeset |
@@ -624,7 +626,10 b' refuse to push unstable changeset' | |||
|
624 | 626 | $ hg push ../tmpc/ |
|
625 | 627 | pushing to ../tmpc/ |
|
626 | 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 | 633 | [255] |
|
629 | 634 | |
|
630 | 635 | with --force it will work anyway |
@@ -647,6 +652,26 b' if the orphan changeset is already on th' | |||
|
647 | 652 | no changes found |
|
648 | 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 | 675 | Test that extinct changeset are properly detected |
|
651 | 676 | |
|
652 | 677 | $ hg log -r 'extinct()' |
@@ -1196,6 +1221,14 b' test whyunstable template keyword' | |||
|
1196 | 1221 | phase-divergent: immutable predecessor 245b |
|
1197 | 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 | 1232 | #if serve |
|
1200 | 1233 | |
|
1201 | 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