comparison mercurial/patch.py @ 6747:f6c00b17387c

use repo[changeid] to get a changectx
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jun 2008 14:35:46 -0500
parents 86e8187b721a
children 87c704ac92d4
comparison
equal deleted inserted replaced
6746:1dca460e7d1e 6747:f6c00b17387c
1178 flcache[f] = flctx._filelog 1178 flcache[f] = flctx._filelog
1179 return flctx 1179 return flctx
1180 1180
1181 # reading the data for node1 early allows it to play nicely 1181 # reading the data for node1 early allows it to play nicely
1182 # with repo.status and the revlog cache. 1182 # with repo.status and the revlog cache.
1183 ctx1 = repo.changectx(node1) 1183 ctx1 = repo[node1]
1184 # force manifest reading 1184 # force manifest reading
1185 man1 = ctx1.manifest() 1185 man1 = ctx1.manifest()
1186 date1 = util.datestr(ctx1.date()) 1186 date1 = util.datestr(ctx1.date())
1187 1187
1188 if not changes: 1188 if not changes:
1190 modified, added, removed, deleted, unknown = changes 1190 modified, added, removed, deleted, unknown = changes
1191 1191
1192 if not modified and not added and not removed: 1192 if not modified and not added and not removed:
1193 return 1193 return
1194 1194
1195 ctx2 = repo.changectx(node2) 1195 ctx2 = repo[node2]
1196 1196
1197 if repo.ui.quiet: 1197 if repo.ui.quiet:
1198 r = None 1198 r = None
1199 else: 1199 else:
1200 hexfunc = repo.ui.debugflag and hex or short 1200 hexfunc = repo.ui.debugflag and hex or short
1201 r = [hexfunc(node) for node in [node1, node2] if node] 1201 r = [hexfunc(node) for node in [node1, node2] if node]
1202 1202
1203 if opts.git: 1203 if opts.git:
1204 copy, diverge = copies.copies(repo, ctx1, ctx2, repo.changectx(nullid)) 1204 copy, diverge = copies.copies(repo, ctx1, ctx2, repo[nullid])
1205 for k, v in copy.items(): 1205 for k, v in copy.items():
1206 copy[v] = k 1206 copy[v] = k
1207 1207
1208 all = modified + added + removed 1208 all = modified + added + removed
1209 all.sort() 1209 all.sort()
1278 1278
1279 total = len(revs) 1279 total = len(revs)
1280 revwidth = max([len(str(rev)) for rev in revs]) 1280 revwidth = max([len(str(rev)) for rev in revs])
1281 1281
1282 def single(rev, seqno, fp): 1282 def single(rev, seqno, fp):
1283 ctx = repo.changectx(rev) 1283 ctx = repo[rev]
1284 node = ctx.node() 1284 node = ctx.node()
1285 parents = [p.node() for p in ctx.parents() if p] 1285 parents = [p.node() for p in ctx.parents() if p]
1286 branch = ctx.branch() 1286 branch = ctx.branch()
1287 if switch_parent: 1287 if switch_parent:
1288 parents.reverse() 1288 parents.reverse()