655 |
655 |
656 elif args['cmd'][0] == 'filelog': |
656 elif args['cmd'][0] == 'filelog': |
657 write(self.filelog(args['file'][0], args['filenode'][0])) |
657 write(self.filelog(args['file'][0], args['filenode'][0])) |
658 |
658 |
659 elif args['cmd'][0] == 'heads': |
659 elif args['cmd'][0] == 'heads': |
660 httphdr("text/plain") |
660 httphdr("application/mercurial-0.1") |
661 h = self.repo.heads() |
661 h = self.repo.heads() |
662 sys.stdout.write(" ".join(map(hex, h)) + "\n") |
662 sys.stdout.write(" ".join(map(hex, h)) + "\n") |
663 |
663 |
664 elif args['cmd'][0] == 'branches': |
664 elif args['cmd'][0] == 'branches': |
665 httphdr("text/plain") |
665 httphdr("application/mercurial-0.1") |
666 nodes = [] |
666 nodes = [] |
667 if args.has_key('nodes'): |
667 if args.has_key('nodes'): |
668 nodes = map(bin, args['nodes'][0].split(" ")) |
668 nodes = map(bin, args['nodes'][0].split(" ")) |
669 for b in self.repo.branches(nodes): |
669 for b in self.repo.branches(nodes): |
670 sys.stdout.write(" ".join(map(hex, b)) + "\n") |
670 sys.stdout.write(" ".join(map(hex, b)) + "\n") |
671 |
671 |
672 elif args['cmd'][0] == 'between': |
672 elif args['cmd'][0] == 'between': |
673 httphdr("text/plain") |
673 httphdr("application/hg-0.1") |
674 nodes = [] |
674 nodes = [] |
675 if args.has_key('pairs'): |
675 if args.has_key('pairs'): |
676 pairs = [ map(bin, p.split("-")) |
676 pairs = [ map(bin, p.split("-")) |
677 for p in args['pairs'][0].split(" ") ] |
677 for p in args['pairs'][0].split(" ") ] |
678 for b in self.repo.between(pairs): |
678 for b in self.repo.between(pairs): |
679 sys.stdout.write(" ".join(map(hex, b)) + "\n") |
679 sys.stdout.write(" ".join(map(hex, b)) + "\n") |
680 |
680 |
681 elif args['cmd'][0] == 'changegroup': |
681 elif args['cmd'][0] == 'changegroup': |
682 httphdr("application/hg-changegroup") |
682 httphdr("application/mercurial-0.1") |
683 nodes = [] |
683 nodes = [] |
684 if self.viewonly: |
684 if self.viewonly: |
685 return |
685 return |
686 |
686 |
687 if args.has_key('roots'): |
687 if args.has_key('roots'): |