The implementation in the class method is used when the root directory has ALREADY been identified, and we're trying to work out what it is.
The CVS implementation there still does the Repository file check. The more important version is the one in Padre::Project::from_file, which is used to determine the project root from a single file. In the from_file version is does actually look up the path, and it specifically checks for the top-most occurrence of either .svn or CVS/Repository. It shouldn't stop half way in the middle of a SVN checkout unless it finds a Makefile.PL or something more type-specific specific. Adam K On 14 February 2011 17:39, Gabor Szabo <szab...@gmail.com> wrote: > On Mon, Feb 14, 2011 at 3:46 AM, <s...@perlide.org> 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 > Padre-dev@perlide.org > http://mail.perlide.org/mailman/listinfo/padre-dev > _______________________________________________ Padre-dev mailing list Padre-dev@perlide.org http://mail.perlide.org/mailman/listinfo/padre-dev