hgbook
diff examples/hg-interdiff @ 947:f2670f1d13f1
Work in progress in tour-basic...
author | Romain PELISSE <belaran@gmail.com> |
---|---|
date | Mon Feb 16 20:18:04 2009 +0100 (2009-02-16) |
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 Feb 16 20:18:04 2009 +0100 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'