diff tests/test-subrepo @ 10522:b07d487009b2 stable

subrepo: Update .hgsubstate in case of deleted subrepo When a subrepo is deleted from .hgsub, it also needs to be removed from .hgsubstate. Previous code was updating .hgsubstate only in case of newly or modified subrepo.
author Saint Germain <saintger@gmail.com>
date Mon, 22 Feb 2010 01:19:59 +0100
parents 2250fc372d34
children 05856e682521 c52057614c72
line wrap: on
line diff
--- a/tests/test-subrepo	Sun Feb 21 22:16:35 2010 +0100
+++ b/tests/test-subrepo	Mon Feb 22 01:19:59 2010 +0100
@@ -162,6 +162,28 @@
 hg merge 4    # try to merge default into br again
 cd ..
 
+echo % test subrepo delete from .hgsubstate
+hg init testdelete
+mkdir testdelete/nested testdelete/nested2
+hg init testdelete/nested
+hg init testdelete/nested2
+echo test > testdelete/nested/foo
+echo test > testdelete/nested2/foo
+hg -R testdelete/nested add
+hg -R testdelete/nested2 add
+hg -R testdelete/nested ci -m test
+hg -R testdelete/nested2 ci -m test
+echo nested = nested > testdelete/.hgsub
+echo nested2 = nested2 >> testdelete/.hgsub
+hg -R testdelete add
+hg -R testdelete ci -m "nested 1 & 2 added"
+echo nested = nested > testdelete/.hgsub
+hg -R testdelete ci -m "nested 2 deleted"
+cat testdelete/.hgsubstate | sed "s:.* ::"
+hg -R testdelete remove testdelete/.hgsub
+hg -R testdelete ci -m ".hgsub deleted"
+cat testdelete/.hgsubstate
+
 echo % test repository cloning
 mkdir mercurial mercurial2
 hg init nested_absolute