From: Eric Wong Date: Fri, 10 Feb 2017 21:23:01 +0000 (+0000) Subject: repo: add class for representing a code repo X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad679cb6bedd72bb70df47dbedac5a8d785ecc2b;p=thirdparty%2Fpublic-inbox.git repo: add class for representing a code repo This should hopefully allow us to organize our code better --- diff --git a/MANIFEST b/MANIFEST index a59d9dcc2..bced28046 100644 --- a/MANIFEST +++ b/MANIFEST @@ -80,6 +80,7 @@ lib/PublicInbox/NewsWWW.pm lib/PublicInbox/ParentPipe.pm lib/PublicInbox/ProcessPipe.pm lib/PublicInbox/Qspawn.pm +lib/PublicInbox/Repo.pm lib/PublicInbox/RepoBase.pm lib/PublicInbox/RepoConfig.pm lib/PublicInbox/RepoGit.pm diff --git a/lib/PublicInbox/Repo.pm b/lib/PublicInbox/Repo.pm new file mode 100644 index 000000000..812b1071c --- /dev/null +++ b/lib/PublicInbox/Repo.pm @@ -0,0 +1,15 @@ +# Copyright (C) 2017 all contributors +# License: AGPL-3.0+ +# +# Represents a code repository, analoguos to the PublicInbox::Inbox +# class for represpenting an inbox git repository. +package PublicInbox::Repo; +use strict; +use warnings; + +sub new { + my ($class, $opts) = @_; + bless $opts, $class; +} + +1; diff --git a/lib/PublicInbox/RepoConfig.pm b/lib/PublicInbox/RepoConfig.pm index 323468525..7a1b316c8 100644 --- a/lib/PublicInbox/RepoConfig.pm +++ b/lib/PublicInbox/RepoConfig.pm @@ -5,6 +5,7 @@ use strict; use warnings; use PublicInbox::Inbox; use PublicInbox::Config; +use PublicInbox::Repo; require PublicInbox::Hval; sub new { @@ -82,7 +83,7 @@ sub lookup { # of course git is the default VCS $rv->{vcs} ||= 'git'; - $self->{-cache}->{$repo_path} = $rv; + $self->{-cache}->{$repo_path} = PublicInbox::Repo->new($rv); } 1;