On Mon, Feb 14, 2011 at 3:46 AM, <[email protected]> wrote:
> Author: adamk
> See also: http://padre.perlide.org/changeset/13689
> Date: 2011-02-13 17:46:20 -0800 (Sun, 13 Feb 2011)
> New Revision: 13689
>
> Modified:
> trunk/Padre/Changes
> trunk/Padre/lib/Padre/Document.pm
> trunk/Padre/lib/Padre/Project.pm
> Log:
> - Intuit project root from version control checkout directories and
> classify them as an ordinary vanilla Padre::Project, before we give up
> and treat something as a Null projects (ADAMK)
>
> Modified: trunk/Padre/lib/Padre/Project.pm
> ===================================================================
> --- trunk/Padre/lib/Padre/Project.pm 2011-02-13 16:01:40 UTC (rev 13688)
> +++ trunk/Padre/lib/Padre/Project.pm 2011-02-14 01:46:20 UTC (rev 13689)
> @@ -37,6 +37,8 @@
> );
> return 'Padre::Project::Null';
> }
> +
> + # There are several main indicators this is a Perl project
> if ( -f File::Spec->catfile( $root, 'Makefile.PL' ) ) {
> return 'Padre::Project::Perl';
> }
> @@ -46,9 +48,24 @@
> if ( -f File::Spec->catfile( $root, 'dist.ini' ) ) {
> return 'Padre::Project::Perl';
> }
> +
> + # Is this a manually configured explicit Padre project
> if ( -f File::Spec->catfile( $root, 'padre.yml' ) ) {
> return 'Padre::Project';
> }
> +
> + # If there are no language-specific indicators, check to see if
> + # this directory is (ideally the root of) a version control checkout.
> + foreach my $vcs ( '.svn', '.git', '.hg', '.bzr' ) {
> + if ( -d File::Spec->catfile($root, $vcs) ) {
> + return 'Padre::Project';
> + }
> + }
> + if ( -f File::Spec->catfile($root, 'CSV', 'Repository') ) {
> + return 'Padre::Project';
> + }
I get that you can usually conclude project root by .git or .hg and
probably .bzr
as there is only a single such directory in every repository but .svn and CVS ?
They appear in every subdirectory as well.
Gabor
_______________________________________________
Padre-dev mailing list
[email protected]
http://mail.perlide.org/mailman/listinfo/padre-dev