##// END OF EJS Templates
extdiff: copy back execbit-only changes to the working directory...
Matt Harbison -
r32283:8a1ff5ed default
parent child Browse files
Show More
@@ -280,7 +280,11 b' def dodiff(ui, repo, cmdline, pats, opts'
280 # all changes. A size check will detect more cases, but not all.
280 # all changes. A size check will detect more cases, but not all.
281 # The only certain way to detect every case is to diff all files,
281 # The only certain way to detect every case is to diff all files,
282 # which could be expensive.
282 # which could be expensive.
283 if cpstat.st_mtime != st.st_mtime or cpstat.st_size != st.st_size:
283 # copyfile() carries over the permission, so the mode check could
284 # be in an 'elif' branch, but for the case where the file has
285 # changed without affecting mtime or size.
286 if (cpstat.st_mtime != st.st_mtime or cpstat.st_size != st.st_size
287 or (cpstat.st_mode & 0o100) != (st.st_mode & 0o100)):
284 ui.debug('file changed while diffing. '
288 ui.debug('file changed while diffing. '
285 'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
289 'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
286 util.copyfile(copy_fn, working_fn)
290 util.copyfile(copy_fn, working_fn)
@@ -329,6 +329,7 b' Fallback to merge-tools.tool.executable|'
329 > # Mimic a tool that syncs all attrs, including mtime
329 > # Mimic a tool that syncs all attrs, including mtime
330 > cp $1/a $2/a
330 > cp $1/a $2/a
331 > touch -r $1/a $2/a
331 > touch -r $1/a $2/a
332 > chmod +x $2/a
332 > echo "** custom diff **"
333 > echo "** custom diff **"
333 > EOF
334 > EOF
334 #if execbit
335 #if execbit
@@ -366,6 +367,32 b' of $tool (and fail).'
366 $ cat a
367 $ cat a
367 a
368 a
368
369
370 #if execbit
371 $ [ -x a ]
372
373 $ cat > 'dir/tool.sh' << 'EOF'
374 > #!/bin/sh
375 > chmod -x $2/a
376 > echo "** custom diff **"
377 > EOF
378
379 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
380 making snapshot of 2 files from rev * (glob)
381 a
382 b
383 making snapshot of 2 files from working directory
384 a
385 b
386 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob)
387 ** custom diff **
388 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob)
389 cleaning up temp directory
390 [1]
391
392 $ [ -x a ]
393 [1]
394 #endif
395
369 $ cd ..
396 $ cd ..
370
397
371 #if symlink
398 #if symlink
General Comments 0
You need to be logged in to leave comments. Login now