##// END OF EJS Templates
Fix hgk for date handling changes
mpm@selenic.com -
r1344:ca0e27e0 default
parent child Browse files
Show More
@@ -13,7 +13,7 b' from mercurial import hg, mdiff, fancyop'
13 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
13 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
14 changes=None, text=False):
14 changes=None, text=False):
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(c[2][0]))
17
17
18 if not changes:
18 if not changes:
19 (c, a, d, u) = repo.changes(node1, node2, files, match=match)
19 (c, a, d, u) = repo.changes(node1, node2, files, match=match)
@@ -64,7 +64,7 b' def difftree(ui, repo, node1=None, node2'
64 """diff trees from two commits"""
64 """diff trees from two commits"""
65 def __difftree(repo, node1, node2):
65 def __difftree(repo, node1, node2):
66 def date(c):
66 def date(c):
67 return time.asctime(time.gmtime(float(c[2].split(' ')[0])))
67 return time.asctime(time.gmtime(c[2][0]))
68
68
69 if node2:
69 if node2:
70 change = repo.changelog.read(node2)
70 change = repo.changelog.read(node2)
@@ -130,7 +130,7 b' def catcommit(repo, n, prefix, changes=N'
130 print "tree %s" % (hg.hex(changes[0]))
130 print "tree %s" % (hg.hex(changes[0]))
131 if i1 != -1: print "parent %s" % (h1)
131 if i1 != -1: print "parent %s" % (h1)
132 if i2 != -1: print "parent %s" % (h2)
132 if i2 != -1: print "parent %s" % (h2)
133 date_ar = changes[2].split(' ')
133 date_ar = changes[2]
134 date = int(float(date_ar[0]))
134 date = int(float(date_ar[0]))
135 lines = changes[4].splitlines()
135 lines = changes[4].splitlines()
136 if lines[-1].startswith('committer:'):
136 if lines[-1].startswith('committer:'):
@@ -288,7 +288,7 b' def revtree(args, repo, full="tree", max'
288 (h, h1, h2) = map(hg.hex, (n, p1, p2))
288 (h, h1, h2) = map(hg.hex, (n, p1, p2))
289 (i1, i2) = map(repo.changelog.rev, (p1, p2))
289 (i1, i2) = map(repo.changelog.rev, (p1, p2))
290
290
291 date = changes[2].split(' ')[0]
291 date = changes[2][0]
292 print "%s %s:%s" % (date, h, mask),
292 print "%s %s:%s" % (date, h, mask),
293 mask = is_reachable(want_sha1, reachable, p1)
293 mask = is_reachable(want_sha1, reachable, p1)
294 if i1 != -1 and mask > 0:
294 if i1 != -1 and mask > 0:
General Comments 0
You need to be logged in to leave comments. Login now