Mercurial > hg
view hg @ 19160:0848be1f1aad stable
largefiles: check existence of the file with case awareness of the filesystem
Before this patch, largefiles extension always unlinks largefiles
untracked on the target context in merging/updating after updating
working directory.
For example, it is assumed that the revision X consists of ".hglf/A"
(and "A" implicitly) and revision Y consists of "a" (not ".hglf/A").
In the case of updating from X to Y, largefiles extension tries to
unlink "A" after updating "a" in working directory. This causes
unexpected unlinking "a" on the case insensitive filesystem.
This patch checks existence of the file in the working context with
case awareness of the filesystem to prevent from such unexpected
unlinking.
"lfcommands._updatelfile()" also unlinks target file in the case
"largefile is tracked in the target context, but fails to be fetched".
This patch doesn't apply "repo.dirstate.normalize()" in this case,
because it should be already ensured in the manifest merging that
there is no normal file colliding against any largefiles.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 07 May 2013 05:04:11 +0900 |
parents | 659f34b833b9 |
children | 73e4a02e6d23 |
line wrap: on
line source
#!/usr/bin/env python # # mercurial - scalable distributed SCM # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import os import sys libdir = '@LIBDIR@' if libdir != '@' 'LIBDIR' '@': if not os.path.isabs(libdir): libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), libdir) libdir = os.path.abspath(libdir) sys.path.insert(0, libdir) # enable importing on demand to reduce startup time try: from mercurial import demandimport; demandimport.enable() except ImportError: import sys sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" % ' '.join(sys.path)) sys.stderr.write("(check your install and PYTHONPATH)\n") sys.exit(-1) import mercurial.util import mercurial.dispatch for fp in (sys.stdin, sys.stdout, sys.stderr): mercurial.util.setbinary(fp) mercurial.dispatch.run()