Show More
@@ -752,8 +752,6 b' def writeworkingdir(repo, ctx, filedata,' | |||||
752 |
|
752 | |||
753 | Directly updates the dirstate for the affected files. |
|
753 | Directly updates the dirstate for the affected files. | |
754 | """ |
|
754 | """ | |
755 | assert repo.dirstate.p2() == nullid |
|
|||
756 |
|
||||
757 | for path, data in pycompat.iteritems(filedata): |
|
755 | for path, data in pycompat.iteritems(filedata): | |
758 | fctx = ctx[path] |
|
756 | fctx = ctx[path] | |
759 | fctx.write(data, fctx.flags()) |
|
757 | fctx.write(data, fctx.flags()) | |
@@ -761,6 +759,7 b' def writeworkingdir(repo, ctx, filedata,' | |||||
761 | oldp1 = repo.dirstate.p1() |
|
759 | oldp1 = repo.dirstate.p1() | |
762 | newp1 = replacements.get(oldp1, oldp1) |
|
760 | newp1 = replacements.get(oldp1, oldp1) | |
763 | if newp1 != oldp1: |
|
761 | if newp1 != oldp1: | |
|
762 | assert repo.dirstate.p2() == nullid | |||
764 | with repo.dirstate.parentchange(): |
|
763 | with repo.dirstate.parentchange(): | |
765 | scmutil.movedirstate(repo, repo[newp1]) |
|
764 | scmutil.movedirstate(repo, repo[newp1]) | |
766 |
|
765 |
@@ -871,6 +871,45 b' prevents us from forgetting fixes made i' | |||||
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. |
General Comments 0
You need to be logged in to leave comments.
Login now