196 relpath = os.getcwd()[len(repo.root) + 1: ] |
196 relpath = os.getcwd()[len(repo.root) + 1: ] |
197 if not args: args = [ relpath ] |
197 if not args: args = [ relpath ] |
198 else: args = [ os.path.join(relpath, x) for x in args ] |
198 else: args = [ os.path.join(relpath, x) for x in args ] |
199 |
199 |
200 diff(args, *revs) |
200 diff(args, *revs) |
|
201 |
|
202 elif cmd == "annotate": |
|
203 aoptions = {} |
|
204 opts = [('r', 'revision', '', 'revision')] |
|
205 args = fancyopts.fancyopts(args, opts, aoptions, |
|
206 'hg annotate [-r id] [files]') |
|
207 if args: |
|
208 node = repo.current |
|
209 if aoptions['revision']: |
|
210 node = repo.changelog.lookup(aoptions['revision']) |
|
211 change = repo.changelog.read(node) |
|
212 mmap = repo.manifest.read(change[0]) |
|
213 for f in args: |
|
214 for n, l in repo.file(f).annotate(mmap[f]): |
|
215 sys.stdout.write("%s: %s"%(n, l)) |
201 |
216 |
202 elif cmd == "export": |
217 elif cmd == "export": |
203 node = repo.lookup(args[0]) |
218 node = repo.lookup(args[0]) |
204 prev, other = repo.changelog.parents(node) |
219 prev, other = repo.changelog.parents(node) |
205 change = repo.changelog.read(node) |
220 change = repo.changelog.read(node) |