Show More
@@ -30,6 +30,20 b' def relpath(repo, args):' | |||
|
30 | 30 | return [util.normpath(os.path.join(cwd, x)) for x in args] |
|
31 | 31 | return args |
|
32 | 32 | |
|
33 | def datestr(change=None): | |
|
34 | if change is None: | |
|
35 | t = time.time() | |
|
36 | if time.daylight: tz = time.altzone | |
|
37 | else: tz = time.timezone | |
|
38 | else: | |
|
39 | t, tz = change[2].split(' ') | |
|
40 | try: | |
|
41 | # a conversion tool was sticking non-integer offsets into repos | |
|
42 | tz = int(tz) | |
|
43 | except ValueError: | |
|
44 | tz = 0 | |
|
45 | return time.asctime(time.gmtime(float(t) - tz)) + " %+05d" % (int(tz)/-36) | |
|
46 | ||
|
33 | 47 | def matchpats(repo, cwd, pats=[], opts={}, head=''): |
|
34 | 48 | return util.matcher(repo.root, cwd, pats or ['.'], opts.get('include'), |
|
35 | 49 | opts.get('exclude'), head) |
@@ -251,9 +265,6 b' def make_file(repo, r, pat, node=None,' | |||
|
251 | 265 | |
|
252 | 266 | def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always, |
|
253 | 267 | changes=None, text=False): |
|
254 | def date(c): | |
|
255 | return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) | |
|
256 | ||
|
257 | 268 | if not changes: |
|
258 | 269 | (c, a, d, u) = repo.changes(node1, node2, files, match=match) |
|
259 | 270 | else: |
@@ -267,11 +278,11 b' def dodiff(fp, ui, repo, node1, node2, f' | |||
|
267 | 278 | if node2: |
|
268 | 279 | change = repo.changelog.read(node2) |
|
269 | 280 | mmap2 = repo.manifest.read(change[0]) |
|
270 | date2 = date(change) | |
|
281 | date2 = datestr(change) | |
|
271 | 282 | def read(f): |
|
272 | 283 | return repo.file(f).read(mmap2[f]) |
|
273 | 284 | else: |
|
274 |
date2 = |
|
|
285 | date2 = datestr() | |
|
275 | 286 | if not node1: |
|
276 | 287 | node1 = repo.dirstate.parents()[0] |
|
277 | 288 | def read(f): |
@@ -285,7 +296,7 b' def dodiff(fp, ui, repo, node1, node2, f' | |||
|
285 | 296 | |
|
286 | 297 | change = repo.changelog.read(node1) |
|
287 | 298 | mmap = repo.manifest.read(change[0]) |
|
288 | date1 = date(change) | |
|
299 | date1 = datestr(change) | |
|
289 | 300 | |
|
290 | 301 | for f in c: |
|
291 | 302 | to = None |
@@ -322,14 +333,7 b' def show_changeset(ui, repo, rev=0, chan' | |||
|
322 | 333 | return |
|
323 | 334 | |
|
324 | 335 | changes = log.read(changenode) |
|
325 | ||
|
326 | t, tz = changes[2].split(' ') | |
|
327 | # a conversion tool was sticking non-integer offsets into repos | |
|
328 | try: | |
|
329 | tz = int(tz) | |
|
330 | except ValueError: | |
|
331 | tz = 0 | |
|
332 | date = time.asctime(time.gmtime(float(t) - tz)) + " %+05d" % (int(tz)/-36) | |
|
336 | date = datestr(changes) | |
|
333 | 337 | |
|
334 | 338 | parents = [(log.rev(p), ui.verbose and hex(p) or short(p)) |
|
335 | 339 | for p in log.parents(changenode) |
General Comments 0
You need to be logged in to leave comments.
Login now