# HG changeset patch # User mpm@selenic.com # Date 1115256387 28800 # Node ID 40b8c158c5407dbdd7ad57b1624beb3a0141ec55 # Parent 54a57a5ebcb14de88a9ed46480d25be8ac1b8147 Document diff in help Add filenames to diff support diff -r 54a57a5ebcb1 -r 40b8c158c540 hg --- a/hg Wed May 04 17:19:02 2005 -0800 +++ b/hg Wed May 04 17:26:27 2005 -0800 @@ -35,6 +35,7 @@ log show revision history of a single file dump [rev] dump the latest or given revision of a file dumpmanifest [rev] dump the latest or given revision of the manifest + diff [files...] diff working directory (or selected files) """ options = {} @@ -123,6 +124,19 @@ mmap = repo.manifest.read(change[0]) (c, a, d) = repo.diffdir(repo.root) + + if args: + nc = [ x for x in c if x in args ] + na = [ x for x in a if x in args ] + nd = [ x for x in d if x in args ] + for arg in args: + if not os.path.isdir(arg): continue + if arg[-1] != os.sep: arg += os.sep + nc += [ x for x in c if x.startswith(arg) ] + na += [ x for x in a if x.startswith(arg) ] + nd += [ x for x in d if x.startswith(arg) ] + (c, a, d) = (nc, na, nd) + for f in c: to = repo.file(f).read(mmap[f]) tn = file(f).read()