hgbook
diff examples/hg-interdiff @ 486:d1962e8a986f
corrected a typo
author | Javier Rojas <jerojasro@devnull.li> |
---|---|
date | Mon Jan 05 23:57:11 2009 -0500 (2009-01-05) |
parents | ba2334e2ba9a |
children |
line diff
1.1 --- a/examples/hg-interdiff Tue Dec 26 16:56:20 2006 -0800 1.2 +++ b/examples/hg-interdiff Mon Jan 05 23:57:11 2009 -0500 1.3 @@ -15,6 +15,9 @@ 1.4 for f in files: 1.5 path = os.path.join(root, f) 1.6 yield path[len(base)+1:], path 1.7 + else: 1.8 + if os.path.isfile(base): 1.9 + yield '', base 1.10 1.11 # create list of unique file names under both directories. 1.12 files = dict(walk(sys.argv[1])) 1.13 @@ -23,8 +26,11 @@ 1.14 files.sort() 1.15 1.16 def name(base, f): 1.17 + if f: 1.18 + path = os.path.join(base, f) 1.19 + else: 1.20 + path = base 1.21 # interdiff requires two files; use /dev/null if one is missing. 1.22 - path = os.path.join(base, f) 1.23 if os.path.exists(path): 1.24 return path 1.25 return '/dev/null'