mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
status: treat symlinks as regular files when unsupported
Summary: Tweak Rust status code to explicitly treat symlinks as regular files if the VFS doesn't support symlinks. This fixes weirdness where they were previously considered "untrackable" and wouldn't show up at all in "hg status". Reviewed By: sggutier, zzl0 Differential Revision: D44521987 fbshipit-source-id: 8944ab115635268c997e5cb443d870b71c353f83
This commit is contained in:
parent
181790e684
commit
3215b15fd5
@ -53,7 +53,13 @@ impl Metadata {
|
||||
}
|
||||
|
||||
pub fn is_file(&self, vfs: &VFS) -> bool {
|
||||
!self.is_symlink(vfs) && self.flags.intersects(MetadataFlags::IS_REGULAR)
|
||||
if vfs.supports_symlinks() {
|
||||
self.flags.intersects(MetadataFlags::IS_REGULAR)
|
||||
} else {
|
||||
// If symlinks aren't supported, treat symlinks as regular files.
|
||||
self.flags
|
||||
.intersects(MetadataFlags::IS_REGULAR | MetadataFlags::IS_SYMLINK)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> Option<u64> {
|
||||
|
@ -301,3 +301,9 @@ Issue995: hg copy -A incorrectly handles symbolic links
|
||||
$ hg mv -A dirlink newdir/dirlink
|
||||
|
||||
$ cd ..
|
||||
|
||||
Don't treat symlinks as untrackable if symlinks aren't supported.
|
||||
$ newclientrepo
|
||||
$ ln -s foo bar
|
||||
$ SL_DEBUG_DISABLE_SYMLINKS=1 hg status
|
||||
? bar
|
||||
|
Loading…
Reference in New Issue
Block a user