changeset 18941:cb5f5859b3fd

test-subrepo: add tests for subrepo "storeclean" checks These tests verify that subrepos are not pushed when their store is clean versus a given target repository.
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Fri, 08 Mar 2013 21:50:27 +0100
parents 798bdb7f1517
children 6891e361bec6
files tests/test-subrepo.t
diffstat 1 files changed, 120 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-subrepo.t	Sat Feb 16 01:21:40 2013 +0100
+++ b/tests/test-subrepo.t	Fri Mar 08 21:50:27 2013 +0100
@@ -289,12 +289,8 @@
   committing subrepository t
   $ hg push
   pushing to $TESTTMP/t (glob)
-  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
-  searching for changes
-  no changes found
-  pushing subrepo s to $TESTTMP/t/s
-  searching for changes
-  no changes found
+  no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
+  no changes made to subrepo s since last push to $TESTTMP/t/s
   pushing subrepo t to $TESTTMP/t/t
   searching for changes
   adding changesets
@@ -314,9 +310,7 @@
   committing subrepository s
   $ hg push
   pushing to $TESTTMP/t (glob)
-  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
-  searching for changes
-  no changes found
+  no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
   pushing subrepo s to $TESTTMP/t/s
   searching for changes
   abort: push creates new remote head 12a213df6fa9! (in subrepo s)
@@ -342,6 +336,122 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files
 
+check that unmodified subrepos are not pushed
+
+  $ hg clone . ../tcc
+  updating to branch default
+  cloning subrepo s from $TESTTMP/tc/s
+  cloning subrepo s/ss from $TESTTMP/tc/s/ss
+  cloning subrepo t from $TESTTMP/tc/t
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+the subrepos on the new clone have nothing to push to its source
+
+  $ hg push -R ../tcc .
+  pushing to .
+  no changes made to subrepo s/ss since last push to s/ss
+  no changes made to subrepo s since last push to s
+  no changes made to subrepo t since last push to t
+  searching for changes
+  no changes found
+  [1]
+
+the subrepos on the source do not have a clean store versus the clone target
+because they were never explicitly pushed to the source
+
+  $ hg push ../tcc
+  pushing to ../tcc
+  pushing subrepo s/ss to ../tcc/s/ss
+  searching for changes
+  no changes found
+  pushing subrepo s to ../tcc/s
+  searching for changes
+  no changes found
+  pushing subrepo t to ../tcc/t
+  searching for changes
+  no changes found
+  searching for changes
+  no changes found
+  [1]
+
+after push their stores become clean
+
+  $ hg push ../tcc
+  pushing to ../tcc
+  no changes made to subrepo s/ss since last push to ../tcc/s/ss
+  no changes made to subrepo s since last push to ../tcc/s
+  no changes made to subrepo t since last push to ../tcc/t
+  searching for changes
+  no changes found
+  [1]
+
+updating a subrepo to a different revision or changing
+its working directory does not make its store dirty
+
+  $ hg -R s update '.^'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg push
+  pushing to $TESTTMP/t
+  no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
+  no changes made to subrepo s since last push to $TESTTMP/t/s
+  no changes made to subrepo t since last push to $TESTTMP/t/t
+  searching for changes
+  no changes found
+  [1]
+  $ echo foo >> s/a
+  $ hg push
+  pushing to $TESTTMP/t
+  no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
+  no changes made to subrepo s since last push to $TESTTMP/t/s
+  no changes made to subrepo t since last push to $TESTTMP/t/t
+  searching for changes
+  no changes found
+  [1]
+  $ hg -R s update -C tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+committing into a subrepo makes its store (but not its parent's store) dirty
+
+  $ echo foo >> s/ss/a
+  $ hg -R s/ss commit -m 'test dirty store detection'
+  $ hg push
+  pushing to $TESTTMP/t
+  pushing subrepo s/ss to $TESTTMP/t/s/ss
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  no changes made to subrepo s since last push to $TESTTMP/t/s
+  no changes made to subrepo t since last push to $TESTTMP/t/t
+  searching for changes
+  no changes found
+  [1]
+
+a subrepo store may be clean versus one repo but not versus another
+
+  $ hg push
+  pushing to $TESTTMP/t
+  no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
+  no changes made to subrepo s since last push to $TESTTMP/t/s
+  no changes made to subrepo t since last push to $TESTTMP/t/t
+  searching for changes
+  no changes found
+  [1]
+  $ hg push ../tcc
+  pushing to ../tcc
+  pushing subrepo s/ss to ../tcc/s/ss
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  no changes made to subrepo s since last push to ../tcc/s
+  no changes made to subrepo t since last push to ../tcc/t
+  searching for changes
+  no changes found
+  [1]
+
 update
 
   $ cd ../t
@@ -372,7 +482,7 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat t/t
   blah