Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/hgit @ 396:8f8bb77d560e
Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
Changes from the original patch:
- - Use 'diff -r ...' instead of 'hg diff -r ...' to support filetype detection
by at least file(1) and vim.
- - Adjusted tests for this change.
- - Some cleanups.
manifest hash: 5f37d1ef75ea7f4e48b53f02371053ba54fb70f8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCsyZzW7P1GVgWeRoRAqczAJ479lR9Z289sP+VH5L+N7pQRU14SACfUueq
88ABloIR3VyRIa4qbujnZio=
=Vva9
-----END PGP SIGNATURE-----
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 17 Jun 2005 20:37:23 +0100 |
parents | 1cb3d9d5119e |
children | d8abb687d501 688d03d6997a |
comparison
equal
deleted
inserted
replaced
395:fbe8834923c5 | 396:8f8bb77d560e |
---|---|
8 # of the GNU General Public License, incorporated herein by reference. | 8 # of the GNU General Public License, incorporated herein by reference. |
9 | 9 |
10 import time, sys, signal | 10 import time, sys, signal |
11 from mercurial import hg, mdiff, fancyopts, commands, ui | 11 from mercurial import hg, mdiff, fancyopts, commands, ui |
12 | 12 |
13 def difftree(args, repo): | 13 def difftree(args, ui, repo): |
14 def __difftree(repo, files = None, node1 = None, node2 = None): | 14 def __difftree(repo, files = None, node1 = None, node2 = None): |
15 def date(c): | 15 def date(c): |
16 return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) | 16 return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) |
17 | 17 |
18 if node2: | 18 if node2: |
59 sys.exit(1) | 59 sys.exit(1) |
60 revs.append(repo.lookup(args[0])) | 60 revs.append(repo.lookup(args[0])) |
61 revs.append(repo.lookup(args[1])) | 61 revs.append(repo.lookup(args[1])) |
62 args = args[2:] | 62 args = args[2:] |
63 if doptions['patch']: | 63 if doptions['patch']: |
64 commands.dodiff(repo, "", args, *revs) | 64 commands.dodiff(ui, repo, "", args, *revs) |
65 else: | 65 else: |
66 __difftree(repo, args, *revs) | 66 __difftree(repo, args, *revs) |
67 | 67 |
68 def catcommit(repo, n, prefix): | 68 def catcommit(repo, n, prefix): |
69 nlprefix = '\n' + prefix; | 69 nlprefix = '\n' + prefix; |
234 u = ui.ui() | 234 u = ui.ui() |
235 signal.signal(signal.SIGTERM, catchterm) | 235 signal.signal(signal.SIGTERM, catchterm) |
236 repo = hg.repository(ui = u) | 236 repo = hg.repository(ui = u) |
237 | 237 |
238 if cmd == "diff-tree": | 238 if cmd == "diff-tree": |
239 difftree(args, repo) | 239 difftree(args, u, repo) |
240 | 240 |
241 elif cmd == "cat-file": | 241 elif cmd == "cat-file": |
242 catfile(args, ui, repo) | 242 catfile(args, u, repo) |
243 | 243 |
244 elif cmd == "rev-tree": | 244 elif cmd == "rev-tree": |
245 revtree(args, repo) | 245 revtree(args, repo) |
246 | 246 |
247 elif cmd == "rev-list": | 247 elif cmd == "rev-list": |