Show More
@@ -37,6 +37,8 class hgweb(object): | |||
|
37 | 37 | self.mtime = -1 |
|
38 | 38 | self.reponame = name |
|
39 | 39 | self.archives = 'zip', 'gz', 'bz2' |
|
40 | self.templatepath = self.repo.ui.config("web", "templates", | |
|
41 | templater.templatepath()) | |
|
40 | 42 | |
|
41 | 43 | def refresh(self): |
|
42 | 44 | mtime = get_mtime(self.repo.root) |
@@ -644,13 +646,13 class hgweb(object): | |||
|
644 | 646 | # tags -> list of changesets corresponding to tags |
|
645 | 647 | # find tag, changeset, file |
|
646 | 648 | |
|
647 | def run(self, req=hgrequest()): | |
|
648 | def clean(path): | |
|
649 | def cleanpath(self, path): | |
|
649 | 650 |
|
|
650 | 651 |
|
|
651 | 652 |
|
|
652 | 653 |
|
|
653 | 654 | |
|
655 | def run(self, req=hgrequest()): | |
|
654 | 656 | def header(**map): |
|
655 | 657 | yield self.t("header", **map) |
|
656 | 658 | |
@@ -686,15 +688,13 class hgweb(object): | |||
|
686 | 688 | |
|
687 | 689 | expand_form(req.form) |
|
688 | 690 | |
|
689 | t = self.repo.ui.config("web", "templates", templater.templatepath()) | |
|
690 | static = self.repo.ui.config("web", "static", os.path.join(t,"static")) | |
|
691 | m = os.path.join(t, "map") | |
|
691 | m = os.path.join(self.templatepath, "map") | |
|
692 | 692 | style = self.repo.ui.config("web", "style", "") |
|
693 | 693 | if req.form.has_key('style'): |
|
694 | 694 | style = req.form['style'][0] |
|
695 | 695 | if style: |
|
696 | 696 | b = os.path.basename("map-" + style) |
|
697 | p = os.path.join(t, b) | |
|
697 | p = os.path.join(self.templatepath, b) | |
|
698 | 698 | if os.path.isfile(p): |
|
699 | 699 | m = p |
|
700 | 700 | |
@@ -719,7 +719,15 class hgweb(object): | |||
|
719 | 719 | req.form['cmd'] = [self.t.cache['default'],] |
|
720 | 720 | |
|
721 | 721 | cmd = req.form['cmd'][0] |
|
722 | if cmd == 'changelog': | |
|
722 | ||
|
723 | method = getattr(self, 'do_' + cmd, None) | |
|
724 | if method: | |
|
725 | method(req) | |
|
726 | else: | |
|
727 | req.write(self.t("error")) | |
|
728 | req.done() | |
|
729 | ||
|
730 | def do_changelog(self, req): | |
|
723 | 731 |
|
|
724 | 732 |
|
|
725 | 733 |
|
@@ -731,41 +739,41 class hgweb(object): | |||
|
731 | 739 | |
|
732 | 740 |
|
|
733 | 741 | |
|
734 | elif cmd == 'changeset': | |
|
742 | def do_changeset(self, req): | |
|
735 | 743 |
|
|
736 | 744 | |
|
737 | elif cmd == 'manifest': | |
|
745 | def do_manifest(self, req): | |
|
738 | 746 |
|
|
739 |
|
|
|
747 | self.cleanpath(req.form['path'][0]))) | |
|
740 | 748 | |
|
741 | elif cmd == 'tags': | |
|
749 | def do_tags(self, req): | |
|
742 | 750 |
|
|
743 | 751 | |
|
744 | elif cmd == 'summary': | |
|
752 | def do_summary(self, req): | |
|
745 | 753 |
|
|
746 | 754 | |
|
747 | elif cmd == 'filediff': | |
|
748 |
|
|
|
755 | def do_filediff(self, req): | |
|
756 | req.write(self.filediff(self.cleanpath(req.form['file'][0]), | |
|
749 | 757 |
|
|
750 | 758 | |
|
751 | elif cmd == 'file': | |
|
752 |
|
|
|
759 | def do_file(self, req): | |
|
760 | req.write(self.filerevision(self.cleanpath(req.form['file'][0]), | |
|
753 | 761 |
|
|
754 | 762 | |
|
755 | elif cmd == 'annotate': | |
|
756 |
|
|
|
763 | def do_annotate(self, req): | |
|
764 | req.write(self.fileannotate(self.cleanpath(req.form['file'][0]), | |
|
757 | 765 |
|
|
758 | 766 | |
|
759 | elif cmd == 'filelog': | |
|
760 |
|
|
|
767 | def do_filelog(self, req): | |
|
768 | req.write(self.filelog(self.cleanpath(req.form['file'][0]), | |
|
761 | 769 |
|
|
762 | 770 | |
|
763 | elif cmd == 'heads': | |
|
771 | def do_heads(self, req): | |
|
764 | 772 |
|
|
765 | 773 |
|
|
766 | 774 |
|
|
767 | 775 | |
|
768 | elif cmd == 'branches': | |
|
776 | def do_branches(self, req): | |
|
769 | 777 |
|
|
770 | 778 |
|
|
771 | 779 |
|
@@ -776,7 +784,7 class hgweb(object): | |||
|
776 | 784 |
|
|
777 | 785 |
|
|
778 | 786 | |
|
779 | elif cmd == 'between': | |
|
787 | def do_between(self, req): | |
|
780 | 788 |
|
|
781 | 789 |
|
|
782 | 790 |
|
@@ -788,7 +796,7 class hgweb(object): | |||
|
788 | 796 |
|
|
789 | 797 |
|
|
790 | 798 | |
|
791 | elif cmd == 'changegroup': | |
|
799 | def do_changegroup(self, req): | |
|
792 | 800 |
|
|
793 | 801 |
|
|
794 | 802 |
|
@@ -807,7 +815,7 class hgweb(object): | |||
|
807 | 815 | |
|
808 | 816 |
|
|
809 | 817 | |
|
810 | elif cmd == 'archive': | |
|
818 | def do_archive(self, req): | |
|
811 | 819 |
|
|
812 | 820 |
|
|
813 | 821 |
|
@@ -818,11 +826,10 class hgweb(object): | |||
|
818 | 826 | |
|
819 | 827 |
|
|
820 | 828 | |
|
821 | elif cmd == 'static': | |
|
829 | def do_static(self, req): | |
|
822 | 830 |
|
|
831 | static = self.repo.ui.config("web", "static", | |
|
832 | os.path.join(self.templatepath, | |
|
833 | "static")) | |
|
823 | 834 |
|
|
824 | 835 |
|
|
825 | ||
|
826 | else: | |
|
827 | req.write(self.t("error")) | |
|
828 | req.done() |
General Comments 0
You need to be logged in to leave comments.
Login now