Skip to content
Snippets Groups Projects
Commit b4ea79f88268 authored by Eli Carter's avatar Eli Carter
Browse files

largefiles: bugfix for symlink handling with testcase

The code was using the size of a symlink's target, thus wrongly making symlinks
to large files into largefiles themselves.  This can be demonstrated by
deleting the symlink and then doing an 'hg up' or 'hg up -C' to restore the
symlink.
parent b357a972d6cd
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@
if exact or not exists:
abovemin = (lfsize and
os.path.getsize(repo.wjoin(f)) >= lfsize * 1024 * 1024)
os.lstat(repo.wjoin(f)).st_size >= lfsize * 1024 * 1024)
if large or abovemin or (lfmatcher and lfmatcher(f)):
lfnames.append(f)
if ui.verbose or not exact:
......
......@@ -852,3 +852,26 @@
1 largefiles updated, 0 removed
$ cd ..
$ HOME="$ORIGHOME"
Symlink to a large largefile should behave the same as a symlink to a normal file
$ hg init largesymlink
$ cd largesymlink
$ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
$ hg add --large largefile
$ hg commit -m "commit a large file"
$ ln -s largefile largelink
$ hg add largelink
$ hg commit -m "commit a large symlink"
$ rm -f largelink
$ hg up >/dev/null
$ test -e largelink
[1]
$ test -L largelink
[1]
$ rm -f largelink # make next part of the test independent of the previous
$ hg up -C >/dev/null
$ test -e largelink
$ test -L largelink
$ cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment