Show More
@@ -294,24 +294,9 def matcher(repo, revs=None, includetemp | |||||
294 | includes, excludes, profiles = patternsforrev(repo, rev) |
|
294 | includes, excludes, profiles = patternsforrev(repo, rev) | |
295 |
|
295 | |||
296 | if includes or excludes: |
|
296 | if includes or excludes: | |
297 | # Explicitly include subdirectories of includes so |
|
|||
298 | # status will walk them down to the actual include. |
|
|||
299 | subdirs = set() |
|
|||
300 | for include in includes: |
|
|||
301 | # TODO consider using posix path functions here so Windows |
|
|||
302 | # \ directory separators don't come into play. |
|
|||
303 | dirname = os.path.dirname(include) |
|
|||
304 | # basename is used to avoid issues with absolute |
|
|||
305 | # paths (which on Windows can include the drive). |
|
|||
306 | while os.path.basename(dirname): |
|
|||
307 | subdirs.add(dirname) |
|
|||
308 | dirname = os.path.dirname(dirname) |
|
|||
309 |
|
||||
310 | matcher = matchmod.match(repo.root, '', [], |
|
297 | matcher = matchmod.match(repo.root, '', [], | |
311 | include=includes, exclude=excludes, |
|
298 | include=includes, exclude=excludes, | |
312 | default='relpath') |
|
299 | default='relpath') | |
313 | if subdirs: |
|
|||
314 | matcher = forceincludematcher(matcher, subdirs) |
|
|||
315 | matchers.append(matcher) |
|
300 | matchers.append(matcher) | |
316 | except IOError: |
|
301 | except IOError: | |
317 | pass |
|
302 | pass |
@@ -284,6 +284,27 Test status on a file in a subdir | |||||
284 | $ hg status |
|
284 | $ hg status | |
285 | ? dir1/dir2/file |
|
285 | ? dir1/dir2/file | |
286 |
|
286 | |||
|
287 | Mix files and subdirectories, both "glob:" and unprefixed | |||
|
288 | ||||
|
289 | $ hg debugsparse --reset | |||
|
290 | $ touch dir1/notshown | |||
|
291 | $ hg commit -A dir1/notshown -m "notshown" | |||
|
292 | $ hg debugsparse --include 'dir1/dir2' | |||
|
293 | $ $PYTHON $TESTDIR/list-tree.py . | grep -v ./.hg | |||
|
294 | ./ | |||
|
295 | ./dir1/ | |||
|
296 | ./dir1/dir2/ | |||
|
297 | ./dir1/dir2/file | |||
|
298 | ./hide.orig | |||
|
299 | $ hg debugsparse --delete 'dir1/dir2' | |||
|
300 | $ hg debugsparse --include 'glob:dir1/dir2' | |||
|
301 | $ $PYTHON $TESTDIR/list-tree.py . | grep -v ./.hg | |||
|
302 | ./ | |||
|
303 | ./dir1/ | |||
|
304 | ./dir1/dir2/ | |||
|
305 | ./dir1/dir2/file | |||
|
306 | ./hide.orig | |||
|
307 | ||||
287 | Test that add -s adds dirs to sparse profile |
|
308 | Test that add -s adds dirs to sparse profile | |
288 |
|
309 | |||
289 | $ hg debugsparse --reset |
|
310 | $ hg debugsparse --reset |
General Comments 0
You need to be logged in to leave comments.
Login now