Show More
@@ -1646,6 +1646,9 class memctx(committablectx): | |||||
1646 | else: |
|
1646 | else: | |
1647 | man[f] = revlog.hash(fctx.data(), p1node, p2node) |
|
1647 | man[f] = revlog.hash(fctx.data(), p1node, p2node) | |
1648 |
|
1648 | |||
|
1649 | for f in self._status.added: | |||
|
1650 | man[f] = revlog.hash(self[f].data(), nullid, nullid) | |||
|
1651 | ||||
1649 | return man |
|
1652 | return man | |
1650 |
|
1653 | |||
1651 | @propertycache |
|
1654 | @propertycache |
@@ -805,7 +805,7 This shouldn't be possible: | |||||
805 | $ hg branch closewithamend |
|
805 | $ hg branch closewithamend | |
806 | marked working directory as branch closewithamend |
|
806 | marked working directory as branch closewithamend | |
807 | (branches are permanent and global, did you want a bookmark?) |
|
807 | (branches are permanent and global, did you want a bookmark?) | |
808 |
$ |
|
808 | $ echo foo > foo | |
809 | $ hg add foo |
|
809 | $ hg add foo | |
810 | $ hg ci -m.. |
|
810 | $ hg ci -m.. | |
811 | $ hg ci --amend --close-branch -m 'closing' |
|
811 | $ hg ci --amend --close-branch -m 'closing' | |
@@ -857,6 +857,55 Test that amend with --edit invokes edit | |||||
857 | $ hg parents --template "{desc}\n" |
|
857 | $ hg parents --template "{desc}\n" | |
858 | editor should be invoked |
|
858 | editor should be invoked | |
859 |
|
859 | |||
|
860 | Test that "diff()" in committemplate works correctly for amending | |||
|
861 | ----------------------------------------------------------------- | |||
|
862 | ||||
|
863 | $ cat >> .hg/hgrc <<EOF | |||
|
864 | > [committemplate] | |||
|
865 | > changeset.commit.amend = {desc}\n | |||
|
866 | > HG: M: {file_mods} | |||
|
867 | > HG: A: {file_adds} | |||
|
868 | > HG: R: {file_dels} | |||
|
869 | > {splitlines(diff()) % 'HG: {line}\n'} | |||
|
870 | > EOF | |||
|
871 | ||||
|
872 | $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n" | |||
|
873 | M: | |||
|
874 | A: foo | |||
|
875 | R: | |||
|
876 | $ hg status -amr | |||
|
877 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo" | |||
|
878 | expecting diff of foo | |||
|
879 | ||||
|
880 | HG: M: | |||
|
881 | HG: A: foo | |||
|
882 | HG: R: | |||
|
883 | HG: diff -r 6de0c1bde1c8 foo | |||
|
884 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |||
|
885 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |||
|
886 | HG: @@ -0,0 +1,1 @@ | |||
|
887 | HG: +foo | |||
|
888 | ||||
|
889 | $ echo y > y | |||
|
890 | $ hg add y | |||
|
891 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y" | |||
|
892 | expecting diff of foo and y | |||
|
893 | ||||
|
894 | HG: M: | |||
|
895 | HG: A: foo y | |||
|
896 | HG: R: | |||
|
897 | HG: diff -r 6de0c1bde1c8 foo | |||
|
898 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |||
|
899 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |||
|
900 | HG: @@ -0,0 +1,1 @@ | |||
|
901 | HG: +foo | |||
|
902 | HG: diff -r 6de0c1bde1c8 y | |||
|
903 | HG: --- /dev/null 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 @@ | |||
|
906 | HG: +y | |||
|
907 | ||||
|
908 | ||||
860 | Check for issue4405 |
|
909 | Check for issue4405 | |
861 | ------------------- |
|
910 | ------------------- | |
862 |
|
911 |
General Comments 0
You need to be logged in to leave comments.
Login now