Commit Graph

5 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
3b929dfbb5 path_auditor: cache names of audited directories
We use a separate cache to avoid problems with

audit = path_auditor(repo.root)
audit("subrepo")
audit("subrepo/file")

whitelisting "subrepo" (which is fine) and then using the same whitelist
with "subrepo/file" (which is not fine).

Since we create a separate path_auditor for every path on the command line,
a "hg add dir/a dir/b dir/c" will still lstat dir 3 times just to audit
the paths.
2007-08-18 21:36:10 -03:00
Bryan O'Sullivan
1b98353d91 Make audit_path more stringent.
The following properties of a path are now checked for:

    - under top-level .hg
    - starts at the root of a windows drive
    - contains ".."
    - traverses a symlink (e.g. a/symlink_here/b)
    - inside a nested repository

If any of these is true, the path is rejected.

The check for traversing a symlink is arguably stricter than necessary;
perhaps we should be checking for symlinks that point outside the
repository.
2007-08-10 10:46:03 -07:00
Vadim Gelfer
38dd424903 revert: require --all to revert all files. 2006-08-21 09:44:52 -07:00
Vadim Gelfer
f90efb1f0f mke test-nested-repo use "revert" instead of "forget" 2006-04-26 12:06:21 -07:00
Vadim Gelfer
16c52d7c61 support nested repositories.
mercurial will not recurse into a subdirectory that contains a .hg
directory. it is treated as a separate repository.
2006-03-31 17:00:09 -08:00