##// END OF EJS Templates
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard -
r14021:3eb632d9 stable
parent child Browse files
Show More
@@ -100,7 +100,8 b' def snapshot(ui, repo, files, node, tmpr'
100 if 'x' in fctx.flags():
100 if 'x' in fctx.flags():
101 util.set_flags(dest, False, True)
101 util.set_flags(dest, False, True)
102 if node is None:
102 if node is None:
103 fns_and_mtime.append((dest, repo.wjoin(fn), os.path.getmtime(dest)))
103 fns_and_mtime.append((dest, repo.wjoin(fn),
104 os.lstat(dest).st_mtime))
104 return dirname, fns_and_mtime
105 return dirname, fns_and_mtime
105
106
106 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
107 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
@@ -222,7 +223,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
222 util.system(cmdline, cwd=tmproot)
223 util.system(cmdline, cwd=tmproot)
223
224
224 for copy_fn, working_fn, mtime in fns_and_mtime:
225 for copy_fn, working_fn, mtime in fns_and_mtime:
225 if os.path.getmtime(copy_fn) != mtime:
226 if os.lstat(copy_fn).st_mtime != mtime:
226 ui.debug('file changed while diffing. '
227 ui.debug('file changed while diffing. '
227 'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
228 'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
228 util.copyfile(copy_fn, working_fn)
229 util.copyfile(copy_fn, working_fn)
@@ -167,4 +167,18 b' Test extdiff with --option:'
167 $ hg falabala -o this -c 1
167 $ hg falabala -o this -c 1
168 diffing this a.8a5febb7f867/a a.34eed99112ab/a
168 diffing this a.8a5febb7f867/a a.34eed99112ab/a
169 [1]
169 [1]
170 $ cd ..
170
171
172 $ hg init testsymlinks
173 $ cd testsymlinks
174 $ echo a > a
175 $ hg ci -Am adda
176 adding a
177 $ echo a >> a
178 $ ln -s missing linka
179 $ hg add linka
180 $ hg falabala -r 0 --traceback
181 diffing testsymlinks.07f494440405 testsymlinks
182 [1]
183 $ cd ..
184
General Comments 0
You need to be logged in to leave comments. Login now