comparison tests/test-fix.t @ 47886:86a60679cf61 stable 5.9.1

fix: again allow formatting the working copy while merging I forgot about unfinished merges (I think I was thinking only about unfinished merge conflicts) when I wrote https://phab.mercurial-scm.org/D11209. As a coworker (hg contributor dploch) reported to me, this led to `hg fix --working-dir` failing when you have an uncommitted merge. The fix is trivial: just move the assertion to just before the call to `scmutil.movedirstate()` where it actually matters. Differential Revision: https://phab.mercurial-scm.org/D11376
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 27 Aug 2021 13:51:44 -0700
parents 66ad7e32011f
children 066cdec8f74f
comparison
equal deleted inserted replaced
47885:3962503cd1e8 47886:86a60679cf61
869 b 869 b
870 CC 870 CC
871 871
872 $ cd .. 872 $ cd ..
873 873
874 We should be allowed to fix the working (and only the working copy) while
875 merging.
876
877 $ hg init fixworkingcopywhilemerging
878 $ cd fixworkingcopywhilemerging
879
880 $ printf "a\nb\nc\n" > file.changed
881 $ hg commit -Aqm "ancestor"
882
883 $ printf "aa\nb\nc\n" > file.changed
884 $ hg commit -m "change a"
885
886 $ hg checkout '.^'
887 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
888 $ printf "a\nb\ncc\n" > file.changed
889 $ hg commit -m "change c"
890 created new head
891
892 $ hg merge
893 merging file.changed
894 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
895 (branch merge, don't forget to commit)
896 $ cat file.changed
897 aa
898 b
899 cc
900 Not allowed to fix a parent of the working copy while merging
901 $ hg fix -r . --working-dir
902 abort: outstanding uncommitted merge
903 (use 'hg commit' or 'hg merge --abort')
904 [20]
905 $ hg fix --working-dir
906 $ cat file.changed
907 AA
908 b
909 CC
910
911 $ cd ..
912
874 Abort fixing revisions if there is an unfinished operation. We don't want to 913 Abort fixing revisions if there is an unfinished operation. We don't want to
875 make things worse by editing files or stripping/obsoleting things. Also abort 914 make things worse by editing files or stripping/obsoleting things. Also abort
876 fixing the working directory if there are unresolved merge conflicts. 915 fixing the working directory if there are unresolved merge conflicts.
877 916
878 $ hg init abortunresolved 917 $ hg init abortunresolved