##// END OF EJS Templates
py3: make a pycompat.osdevnull, use it in extdiff...
Kyle Lippincott -
r44229:765a9c29 default
parent child Browse files
Show More
@@ -271,7 +271,7 b' def _runperfilediff('
271 path1a = os.path.join(tmproot, dir1a, commonfile)
271 path1a = os.path.join(tmproot, dir1a, commonfile)
272 label1a = commonfile + rev1a
272 label1a = commonfile + rev1a
273 if not os.path.isfile(path1a):
273 if not os.path.isfile(path1a):
274 path1a = os.devnull
274 path1a = pycompat.osdevnull
275
275
276 path1b = b''
276 path1b = b''
277 label1b = b''
277 label1b = b''
@@ -279,7 +279,7 b' def _runperfilediff('
279 path1b = os.path.join(tmproot, dir1b, commonfile)
279 path1b = os.path.join(tmproot, dir1b, commonfile)
280 label1b = commonfile + rev1b
280 label1b = commonfile + rev1b
281 if not os.path.isfile(path1b):
281 if not os.path.isfile(path1b):
282 path1b = os.devnull
282 path1b = pycompat.osdevnull
283
283
284 path2 = os.path.join(dir2root, dir2, commonfile)
284 path2 = os.path.join(dir2root, dir2, commonfile)
285 label2 = commonfile + rev2
285 label2 = commonfile + rev2
@@ -468,12 +468,12 b' def dodiff(ui, repo, cmdline, pats, opts'
468 dir1a = os.path.join(tmproot, dir1a, common_file)
468 dir1a = os.path.join(tmproot, dir1a, common_file)
469 label1a = common_file + rev1a
469 label1a = common_file + rev1a
470 if not os.path.isfile(dir1a):
470 if not os.path.isfile(dir1a):
471 dir1a = os.devnull
471 dir1a = pycompat.osdevnull
472 if do3way:
472 if do3way:
473 dir1b = os.path.join(tmproot, dir1b, common_file)
473 dir1b = os.path.join(tmproot, dir1b, common_file)
474 label1b = common_file + rev1b
474 label1b = common_file + rev1b
475 if not os.path.isfile(dir1b):
475 if not os.path.isfile(dir1b):
476 dir1b = os.devnull
476 dir1b = pycompat.osdevnull
477 dir2 = os.path.join(dir2root, dir2, common_file)
477 dir2 = os.path.join(dir2root, dir2, common_file)
478 label2 = common_file + rev2
478 label2 = common_file + rev2
479 else:
479 else:
@@ -118,6 +118,7 b' if ispy3:'
118 osaltsep = os.altsep
118 osaltsep = os.altsep
119 if osaltsep:
119 if osaltsep:
120 osaltsep = osaltsep.encode('ascii')
120 osaltsep = osaltsep.encode('ascii')
121 osdevnull = os.devnull.encode('ascii')
121
122
122 sysplatform = sys.platform.encode('ascii')
123 sysplatform = sys.platform.encode('ascii')
123 sysexecutable = sys.executable
124 sysexecutable = sys.executable
@@ -456,6 +457,7 b' else:'
456 ospardir = os.pardir
457 ospardir = os.pardir
457 ossep = os.sep
458 ossep = os.sep
458 osaltsep = os.altsep
459 osaltsep = os.altsep
460 osdevnull = os.devnull
459 long = long
461 long = long
460 stdin = sys.stdin
462 stdin = sys.stdin
461 stdout = sys.stdout
463 stdout = sys.stdout
@@ -515,3 +515,27 b' Test handling of non-ASCII paths in gene'
515 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \
515 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \
516 > | grep "^ '"
516 > | grep "^ '"
517 '\xa5\xa5'
517 '\xa5\xa5'
518
519 $ cd $TESTTMP
520
521 Test that diffing a single file works, even if that file is new
522
523 $ hg init testsinglefile
524 $ cd testsinglefile
525 $ echo a > a
526 $ hg add a
527 $ hg falabala
528 diffing * */a (glob)
529 [1]
530 $ hg ci -qm a
531 $ hg falabala -c .
532 diffing * */a (glob)
533 [1]
534 $ echo a >> a
535 $ hg falabala
536 diffing */a */a (glob)
537 [1]
538 $ hg ci -qm 2a
539 $ hg falabala -c .
540 diffing */a */a (glob)
541 [1]
General Comments 0
You need to be logged in to leave comments. Login now