Show More
@@ -648,25 +648,6 b' class hgweb(object):' | |||
|
648 | 648 | form[name] = value |
|
649 | 649 | del form[k] |
|
650 | 650 | |
|
651 | if form.has_key('manifest'): | |
|
652 | changeid = form['manifest'][0] | |
|
653 | try: | |
|
654 | req.changectx = self.repo.changectx(changeid) | |
|
655 | except hg.RepoError: | |
|
656 | man = self.repo.manifest | |
|
657 | mn = man.lookup(changeid) | |
|
658 | req.changectx = self.repo.changectx(man.linkrev(mn)) | |
|
659 | ||
|
660 | if form.has_key('filenode'): | |
|
661 | changeid = form['filenode'][0] | |
|
662 | path = self.cleanpath(form['file'][0]) | |
|
663 | try: | |
|
664 | req.changectx = self.repo.changectx(changeid) | |
|
665 | req.filectx = req.changectx.filectx(path) | |
|
666 | except hg.RepoError: | |
|
667 | req.filectx = self.repo.filectx(path, fileid=changeid) | |
|
668 | req.changectx = req.filectx.changectx() | |
|
669 | ||
|
670 | 651 | self.refresh() |
|
671 | 652 | |
|
672 | 653 | expand_form(req.form) |
@@ -710,6 +691,34 b' class hgweb(object):' | |||
|
710 | 691 | else: |
|
711 | 692 | req.write(self.t("error")) |
|
712 | 693 | |
|
694 | def changectx(self, req): | |
|
695 | if req.form.has_key('node'): | |
|
696 | changeid = req.form['node'][0] | |
|
697 | else: | |
|
698 | changeid = req.form['manifest'][0] | |
|
699 | try: | |
|
700 | ctx = self.repo.changectx(changeid) | |
|
701 | except hg.RepoError: | |
|
702 | man = self.repo.manifest | |
|
703 | mn = man.lookup(changeid) | |
|
704 | ctx = self.repo.changectx(man.linkrev(mn)) | |
|
705 | ||
|
706 | return ctx | |
|
707 | ||
|
708 | def filectx(self, req): | |
|
709 | path = self.cleanpath(req.form['file'][0]) | |
|
710 | if req.form.has_key('node'): | |
|
711 | changeid = req.form['node'][0] | |
|
712 | else: | |
|
713 | changeid = req.form['filenode'][0] | |
|
714 | try: | |
|
715 | ctx = self.repo.changectx(changeid) | |
|
716 | fctx = ctx.filectx(path) | |
|
717 | except hg.RepoError: | |
|
718 | fctx = self.repo.filectx(path, fileid=changeid) | |
|
719 | ||
|
720 | return fctx | |
|
721 | ||
|
713 | 722 | def stripes(self, parity): |
|
714 | 723 | "make horizontal stripes for easier reading" |
|
715 | 724 | if self.stripecount: |
@@ -717,38 +726,31 b' class hgweb(object):' | |||
|
717 | 726 | else: |
|
718 | 727 | return 0 |
|
719 | 728 | |
|
720 | def do_changelog(self, req): | |
|
721 |
if req.form.has_key(' |
|
|
722 | hi = req.form['rev'][0] | |
|
729 | def do_changelog(self, req, shortlog = False): | |
|
730 | if req.form.has_key('node'): | |
|
731 | ctx = self.changectx(req) | |
|
723 | 732 | else: |
|
724 | hi = self.repo.changelog.count() - 1 | |
|
725 | try: | |
|
726 | ctx = self.repo.changectx(hi) | |
|
727 | except hg.RepoError: | |
|
728 | req.write(self.search(hi)) # XXX redirect to 404 page? | |
|
729 | return | |
|
733 | if req.form.has_key('rev'): | |
|
734 | hi = req.form['rev'][0] | |
|
735 | else: | |
|
736 | hi = self.repo.changelog.count() - 1 | |
|
737 | try: | |
|
738 | ctx = self.repo.changectx(hi) | |
|
739 | except hg.RepoError: | |
|
740 | req.write(self.search(hi)) # XXX redirect to 404 page? | |
|
741 | return | |
|
730 | 742 | |
|
731 | req.write(self.changelog(ctx)) | |
|
743 | req.write(self.changelog(ctx, shortlog = shortlog)) | |
|
732 | 744 | |
|
733 | 745 | def do_shortlog(self, req): |
|
734 | if req.form.has_key('rev'): | |
|
735 | hi = req.form['rev'][0] | |
|
736 | else: | |
|
737 | hi = self.repo.changelog.count() - 1 | |
|
738 | try: | |
|
739 | hi = self.repo.changectx(hi) | |
|
740 | except hg.RepoError: | |
|
741 | req.write(self.search(hi)) # XXX redirect to 404 page? | |
|
742 | return | |
|
743 | ||
|
744 | req.write(self.changelog(ctx, shortlog = True)) | |
|
746 | self.do_changelog(req, shortlog = True) | |
|
745 | 747 | |
|
746 | 748 | def do_changeset(self, req): |
|
747 | 749 | ctx = self.repo.changectx(req.form['node'][0]) |
|
748 | 750 | req.write(self.changeset(ctx)) |
|
749 | 751 | |
|
750 | 752 | def do_manifest(self, req): |
|
751 |
req.write(self.manifest( |
|
|
753 | req.write(self.manifest(self.changectx(req), | |
|
752 | 754 | self.cleanpath(req.form['path'][0]))) |
|
753 | 755 | |
|
754 | 756 | def do_tags(self, req): |
@@ -758,18 +760,16 b' class hgweb(object):' | |||
|
758 | 760 | req.write(self.summary()) |
|
759 | 761 | |
|
760 | 762 | def do_filediff(self, req): |
|
761 | ctx = self.repo.changectx(req.form['node'][0]) | |
|
762 | fctx = ctx.filectx(self.cleanpath(req.form['file'][0])) | |
|
763 | req.write(self.filediff(fctx)) | |
|
763 | req.write(self.filediff(self.filectx(req))) | |
|
764 | 764 | |
|
765 | 765 | def do_file(self, req): |
|
766 |
req.write(self.filerevision( |
|
|
766 | req.write(self.filerevision(self.filectx(req))) | |
|
767 | 767 | |
|
768 | 768 | def do_annotate(self, req): |
|
769 |
req.write(self.fileannotate( |
|
|
769 | req.write(self.fileannotate(self.filectx(req))) | |
|
770 | 770 | |
|
771 | 771 | def do_filelog(self, req): |
|
772 |
req.write(self.filelog( |
|
|
772 | req.write(self.filelog(self.filectx(req))) | |
|
773 | 773 | |
|
774 | 774 | def do_heads(self, req): |
|
775 | 775 | resp = " ".join(map(hex, self.repo.heads())) + "\n" |
General Comments 0
You need to be logged in to leave comments.
Login now