Skip to content
Snippets Groups Projects
Commit 3eb632d9 authored by Patrick Mezard's avatar Patrick Mezard
Browse files

extdiff: fix broken symlinks handling (issue1909)

parent 42d51659
No related merge requests found
......@@ -100,7 +100,8 @@
if 'x' in fctx.flags():
util.set_flags(dest, False, True)
if node is None:
fns_and_mtime.append((dest, repo.wjoin(fn), os.path.getmtime(dest)))
fns_and_mtime.append((dest, repo.wjoin(fn),
os.lstat(dest).st_mtime))
return dirname, fns_and_mtime
def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
......@@ -222,7 +223,7 @@
util.system(cmdline, cwd=tmproot)
for copy_fn, working_fn, mtime in fns_and_mtime:
if os.path.getmtime(copy_fn) != mtime:
if os.lstat(copy_fn).st_mtime != mtime:
ui.debug('file changed while diffing. '
'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
util.copyfile(copy_fn, working_fn)
......
......@@ -167,4 +167,5 @@
$ hg falabala -o this -c 1
diffing this a.8a5febb7f867/a a.34eed99112ab/a
[1]
$ cd ..
......@@ -170,1 +171,14 @@
$ hg init testsymlinks
$ cd testsymlinks
$ echo a > a
$ hg ci -Am adda
adding a
$ echo a >> a
$ ln -s missing linka
$ hg add linka
$ hg falabala -r 0 --traceback
diffing testsymlinks.07f494440405 testsymlinks
[1]
$ 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