comparison mercurial/commands.py @ 1321:b47f96a178a3

Clean up date and timezone handling. We used to pass changelog dates around as a "unixtime timezone" string containing a pair of encoded ints. Now, they get passed around as a (unixtime, timezone) tuple of numbers, which makes much more sense.
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 22 Sep 2005 23:19:47 -0700
parents 5f277e73778f
children 57220daf40e9
comparison
equal deleted inserted replaced
1320:5f277e73778f 1321:b47f96a178a3
262 return 262 return
263 263
264 if node2: 264 if node2:
265 change = repo.changelog.read(node2) 265 change = repo.changelog.read(node2)
266 mmap2 = repo.manifest.read(change[0]) 266 mmap2 = repo.manifest.read(change[0])
267 date2 = util.datestr(change) 267 date2 = util.datestr(change[2])
268 def read(f): 268 def read(f):
269 return repo.file(f).read(mmap2[f]) 269 return repo.file(f).read(mmap2[f])
270 else: 270 else:
271 date2 = util.datestr() 271 date2 = util.datestr()
272 if not node1: 272 if not node1:
280 hexfunc = ui.verbose and hex or short 280 hexfunc = ui.verbose and hex or short
281 r = [hexfunc(node) for node in [node1, node2] if node] 281 r = [hexfunc(node) for node in [node1, node2] if node]
282 282
283 change = repo.changelog.read(node1) 283 change = repo.changelog.read(node1)
284 mmap = repo.manifest.read(change[0]) 284 mmap = repo.manifest.read(change[0])
285 date1 = util.datestr(change) 285 date1 = util.datestr(change[2])
286 286
287 for f in c: 287 for f in c:
288 to = None 288 to = None
289 if f in mmap: 289 if f in mmap:
290 to = repo.file(f).read(mmap[f]) 290 to = repo.file(f).read(mmap[f])
317 if ui.quiet: 317 if ui.quiet:
318 ui.write("%d:%s\n" % (rev, short(changenode))) 318 ui.write("%d:%s\n" % (rev, short(changenode)))
319 return 319 return
320 320
321 changes = log.read(changenode) 321 changes = log.read(changenode)
322 date = util.datestr(changes) 322 date = util.datestr(changes[2])
323 323
324 parents = [(log.rev(p), ui.verbose and hex(p) or short(p)) 324 parents = [(log.rev(p), ui.verbose and hex(p) or short(p))
325 for p in log.parents(changenode) 325 for p in log.parents(changenode)
326 if ui.debugflag or p != nullid] 326 if ui.debugflag or p != nullid]
327 if not ui.debugflag and len(parents) == 1 and parents[0][0] == rev-1: 327 if not ui.debugflag and len(parents) == 1 and parents[0][0] == rev-1: