changeset 13233:0b30e6148ec5 stable

subrepo: do not report known files inside repositories as unknown
author Oleg Stepanov <oleg.stepanov@jetbrains.com>
date Tue, 04 Jan 2011 03:53:11 -0800
parents b25b5ad0cca8
children 0935ff767285 a01c52b08c5f
files mercurial/dirstate.py tests/test-subrepo.t
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Wed Jan 05 10:57:52 2011 +0100
+++ b/mercurial/dirstate.py	Tue Jan 04 03:53:11 2011 -0800
@@ -503,7 +503,7 @@
         i, j = 0, 0
         while i < len(files) and j < len(subrepos):
             subpath = subrepos[j] + "/"
-            if not files[i].startswith(subpath):
+            if files[i] < subpath:
                 i += 1
                 continue
             while files and files[i].startswith(subpath):
--- a/tests/test-subrepo.t	Wed Jan 05 10:57:52 2011 +0100
+++ b/tests/test-subrepo.t	Tue Jan 04 03:53:11 2011 -0800
@@ -656,3 +656,22 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
+
+Check status of files when none of them belong to the first
+subrepository:
+
+  $ hg init subrepo-status
+  $ cd subrepo-status
+  $ hg init subrepo-1
+  $ hg init subrepo-2
+  $ cd subrepo-2
+  $ touch file
+  $ hg add file
+  $ cd ..
+  $ echo subrepo-1 = subrepo-1 > .hgsub
+  $ echo subrepo-2 = subrepo-2 >> .hgsub
+  $ hg add .hgsub
+  $ hg ci -m 'Added subrepos'
+  committing subrepository subrepo-1
+  committing subrepository subrepo-2
+  $ hg st subrepo-2/file