]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
repobrowse: queries are VCS-specific
authorEric Wong <e@80x24.org>
Thu, 14 Jan 2016 00:47:28 +0000 (00:47 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Apr 2016 18:58:27 +0000 (18:58 +0000)
While we want to keep a consistent set of parameters across
different VCSes, we cannot expect users of non-git VCSes to
use the same parameter names which make sense for git users.

lib/PublicInbox/RepobrowseBase.pm
lib/PublicInbox/RepobrowseGitBlob.pm
lib/PublicInbox/RepobrowseGitCommit.pm
lib/PublicInbox/RepobrowseGitLog.pm
lib/PublicInbox/RepobrowseGitPatch.pm
lib/PublicInbox/RepobrowseGitPlain.pm
lib/PublicInbox/RepobrowseGitQuery.pm [moved from lib/PublicInbox/RepobrowseQuery.pm with 95% similarity]
lib/PublicInbox/RepobrowseGitTag.pm
lib/PublicInbox/RepobrowseGitTree.pm

index 06381b2a3c33f6d746cfe124fe1e3dacca60a5d5..60da2d948360e40d649263a5f48446041f2096a0 100644 (file)
@@ -3,7 +3,7 @@
 package PublicInbox::RepobrowseBase;
 use strict;
 use warnings;
-require PublicInbox::RepobrowseQuery;
+require PublicInbox::RepobrowseGitQuery;
 use PublicInbox::Hval;
 
 sub new { bless {}, shift }
index 273a10186854ec63100a2ae0b9f01c8eedcb0a46..e890ae847e584209a2903b6118aa189071cf32e3 100644 (file)
@@ -12,7 +12,7 @@ our @EXPORT = qw(git_blob_mime_type git_blob_stream_response);
 sub call_git_blob {
        my ($self, $req) = @_;
        my $git = $req->{repo_info}->{git};
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $id = $q->{id};
        $id eq '' and $id = 'HEAD';
 
index b3973392cd11a4a651d4a1519ca432bb2c2d539b..5c8407b2d68d23708f23efae40908be1912aac48 100644 (file)
@@ -118,7 +118,7 @@ sub git_commit_stream {
 sub call_git_commit {
        my ($self, $req) = @_;
 
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $id = $q->{id};
        $id eq '' and $id = 'HEAD';
        my $git = $req->{repo_info}->{git};
index 5d2c855cc611cd16041e249575c0b04b41055777..4c1697075f52b6a8d16d4d69fa8032cd45f18c5f 100644 (file)
@@ -19,7 +19,7 @@ sub call_git_log {
        $max = int($max);
        $max = 50 if $max == 0;
 
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $h = $q->{h};
        $h eq '' and $h = 'HEAD';
 
index 7f03864e40a7004c9d64d98ce7136318eafc41e0..4cb059607164a3b40772913cdbcccfab34b78b5f 100644 (file)
@@ -15,7 +15,7 @@ my $sig = '--signature=git '.join(' ', @CMD);
 sub call_git_patch {
        my ($self, $req) = @_;
        my $git = $req->{repo_info}->{git};
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $id = $q->{id};
        $id =~ /\A[\w-]+([~\^][~\^\d])*\z/ or $id = 'HEAD';
 
index ebb4f39721a0d4ac03d560ce0bf759b03f2e3b65..89788a10703440d1100b65e3c5010a75da9dd179 100644 (file)
@@ -10,7 +10,7 @@ use PublicInbox::Hval qw(utf8_html);
 sub call_git_plain {
        my ($self, $req) = @_;
        my $git = $req->{repo_info}->{git};
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $id = $q->{id};
        $id eq '' and $id = 'HEAD';
 
similarity index 95%
rename from lib/PublicInbox/RepobrowseQuery.pm
rename to lib/PublicInbox/RepobrowseGitQuery.pm
index e9c5153f8b221f74d58f24b444c435db73bde15f..018b20c92f1e68649e81a0b1dfa70cabd1ed7bf2 100644 (file)
@@ -2,7 +2,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # query parameter management for repobrowse
-package PublicInbox::RepobrowseQuery;
+package PublicInbox::RepobrowseGitQuery;
 use strict;
 use warnings;
 use PublicInbox::Hval;
index 13af0a34800fc318d3904d054d830d1d476cda4f..ebda729eb967bd803b24a058f8de7f9005e7751e 100644 (file)
@@ -18,7 +18,7 @@ my %cmd_map = ( # type => action
 sub call_git_tag {
        my ($self, $req) = @_;
 
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $h = $q->{h};
        $h eq '' and return sub {
                my ($res) = @_;
index 13ded634d2e60f8f77af850339e3c78ddfb81934..e8012dde39e892ed4c0b9ae4beef0a4b6c765bb4 100644 (file)
@@ -20,7 +20,7 @@ sub git_tree_stream {
        my ($self, $req, $res) = @_; # res: Plack callback
        my @extra = @{$req->{extra}};
        my $git = $req->{repo_info}->{git};
-       my $q = PublicInbox::RepobrowseQuery->new($req->{cgi});
+       my $q = PublicInbox::RepobrowseGitQuery->new($req->{cgi});
        my $id = $q->{id};
        if ($id eq '') {
                chomp($id = $git->qx(qw(rev-parse --short=10 HEAD)));