[PATCH 1 of 3 DEFAULT] tests: add subrepo recursion tests for add/forget with explicit paths

David M. Carr david at carrclan.us
Tue Jan 17 18:36:26 CST 2012


# HG changeset patch
# User David M. Carr  <david at carrclan.us>
# Date 1326845454 18000
# Node ID d687d007ec1e2eb6f660043b108150cc9b452a0c
# Parent  6902e13ddd03c2d071889d092d06419abb99f278
tests: add subrepo recursion tests for add/forget with explicit paths

When support for handling add/forget of explicit paths within subrepos was
added (9e99d2bbb1b1/95174c381525), nested subrepos weren't handled properly.
This change adds test coverage to expose the broken behavior, which will be
fixed in later patches.

diff -r 6902e13ddd03 -r d687d007ec1e tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t	Mon Jan 16 01:21:22 2012 -0600
+++ b/tests/test-subrepo-recursion.t	Tue Jan 17 19:10:54 2012 -0500
@@ -188,6 +188,30 @@
   committing subrepository foo
   committing subrepository foo/bar (glob)
 
+Test explicit path commands within subrepos: add/forget
+  $ echo z1 > foo/bar/z2.txt
+  $ hg status -S
+  ? foo/bar/z2.txt
+  $ hg add foo/bar/z2.txt
+This is expected to add the file, but is currently broken
+  $ hg status -S
+  ? foo/bar/z2.txt
+When fixed, remove the next two commands
+  $ hg add -R foo/bar foo/bar/z2.txt
+  $ hg status -S
+  A foo/bar/z2.txt
+This is expected to forget the file, but is currently broken
+  $ hg forget foo/bar/z2.txt
+  not removing foo/bar/z2.txt: file is already untracked
+  [1]
+  $ hg status -S
+  A foo/bar/z2.txt
+When fixed, remove the next two commands
+  $ hg forget -R foo/bar foo/bar/z2.txt
+  $ hg status -S
+  ? foo/bar/z2.txt
+  $ rm foo/bar/z2.txt
+
 Log with the relationships between repo and its subrepo:
 
   $ hg log --template '{rev}:{node|short} {desc}\n'


More information about the Mercurial-devel mailing list