tests/test-import.t
changeset 26631 e077ce385609
parent 26562 dd2f5e014806
child 26750 9f9ec4abe700
--- a/tests/test-import.t	Wed Oct 14 02:40:04 2015 +0900
+++ b/tests/test-import.t	Tue Oct 13 12:25:43 2015 -0700
@@ -428,6 +428,25 @@
   working directory now based on revision 0
   $ hg --cwd b parents --template 'parent: {rev}\n'
   parent: 0
+
+Test that "hg rollback" doesn't restore dirstate to one at the
+beginning of the rollbacked transaction in not-"parent-gone" case.
+
+invoking pretxncommit hook will cause marking '.hg/dirstate' as a file
+to be restored at rollbacking, after DirstateTransactionPlan (see wiki
+page for detail).
+
+  $ hg --cwd b branch -q foobar
+  $ hg --cwd b commit -m foobar
+  $ hg --cwd b update 0 -q
+  $ hg --cwd b import ../patch1 ../patch2 --config hooks.pretxncommit=true
+  applying ../patch1
+  applying ../patch2
+  $ hg --cwd b update -q 1
+  $ hg --cwd b rollback -q
+  $ hg --cwd b parents --template 'parent: {rev}\n'
+  parent: 1
+
   $ rm -r b