Mercurial > hg
comparison tests/test-commit-amend.t @ 23589:200215cdf7aa
memctx: calculate manifest correctly with newly-removed files (issue4470)
Before this patch, "memctx._manifest" tries to get (and use normally)
filectx also for newly-removed files, even though "memctx.filectx()"
returns None for such files.
To calculate manifest correctly even with newly-removed files, this
patch does:
- replace "man.iteritems()" for the loop by "self._status.modified"
to avoid accessing itself to newly removed files
this also reduces loop cost for large manifest.
- remove files in "self._status.removed" from the manifest
In this patch, amending is confirmed twice to examine both (1) newly
removed files and (2) ones already removed in amended revision.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 17 Dec 2014 15:09:43 +0900 |
parents | 87a76cff7147 |
children | 4ab66de46a96 |
comparison
equal
deleted
inserted
replaced
23588:87a76cff7147 | 23589:200215cdf7aa |
---|---|
903 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 903 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
904 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | 904 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 |
905 HG: @@ -0,0 +1,1 @@ | 905 HG: @@ -0,0 +1,1 @@ |
906 HG: +y | 906 HG: +y |
907 | 907 |
908 $ hg rm a | |
909 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y" | |
910 expecting diff of a, foo and y | |
911 | |
912 HG: M: | |
913 HG: A: foo y | |
914 HG: R: a | |
915 HG: diff -r 6de0c1bde1c8 a | |
916 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
917 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
918 HG: @@ -1,2 +0,0 @@ | |
919 HG: -a | |
920 HG: -a | |
921 HG: diff -r 6de0c1bde1c8 foo | |
922 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
923 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
924 HG: @@ -0,0 +1,1 @@ | |
925 HG: +foo | |
926 HG: diff -r 6de0c1bde1c8 y | |
927 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
928 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
929 HG: @@ -0,0 +1,1 @@ | |
930 HG: +y | |
931 | |
932 $ hg rm x | |
933 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y" | |
934 expecting diff of a, foo, x and y | |
935 | |
936 HG: M: | |
937 HG: A: foo y | |
938 HG: R: a x | |
939 HG: diff -r 6de0c1bde1c8 a | |
940 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
941 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
942 HG: @@ -1,2 +0,0 @@ | |
943 HG: -a | |
944 HG: -a | |
945 HG: diff -r 6de0c1bde1c8 foo | |
946 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
947 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
948 HG: @@ -0,0 +1,1 @@ | |
949 HG: +foo | |
950 HG: diff -r 6de0c1bde1c8 x | |
951 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 | |
952 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
953 HG: @@ -1,1 +0,0 @@ | |
954 HG: -x | |
955 HG: diff -r 6de0c1bde1c8 y | |
956 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
957 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
958 HG: @@ -0,0 +1,1 @@ | |
959 HG: +y | |
908 | 960 |
909 Check for issue4405 | 961 Check for issue4405 |
910 ------------------- | 962 ------------------- |
911 | 963 |
912 Setup the repo with a file that gets moved in a second commit. | 964 Setup the repo with a file that gets moved in a second commit. |