Changeset 2022 in ProjectBuilder


Ignore:
Timestamp:
Dec 6, 2015, 3:46:51 AM (8 years ago)
Author:
Bruno Cornec
Message:
  • Improve git support where pbconf is upstream in the main directory of a simple project
Location:
devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r1958 r2022  
    309309    #
    310310    pb_vcs_compliant("pbconfdir",'PBCONFDIR',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit);
     311    my ($scheme, $account, $host, $port, $path) = pb_get_uri($pbconf{$ENV{'PBPROJ'}});
    311312
    312313    # Check where is our PBROOTDIR (release tag name can't be guessed the first time)
     
    327328        # transform in full path if relative
    328329        $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$ENV{'PBROOTDIR'}" if ($ENV{'PBROOTDIR'} !~ /^\//);
     330        # If git, then versions are in branch not in dirs.
     331        $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}" if ($scheme =~ /^git/);
    329332        pb_mkdir_p($ENV{'PBROOTDIR'}) if (defined $pbinit);
    330333        die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'});
  • devel/pb-modules/lib/ProjectBuilder/VCS.pm

    r1958 r2022  
    447447} elsif ($scheme =~ /^((hg)|(git))/o) {
    448448    foreach my $d (@dir) {
    449         pb_system("(cd $d && $vcscmd pull)", "Updating $d ");
     449        pb_system("(cd $d && $vcscmd fetch)", "Updating $d ");
    450450    }
    451451} elsif ($scheme =~ /^(flat)|(ftp)|(http)|(file)\b/o) {
     
    545545my $l = undef;
    546546
    547 if ($scheme =~ /^((svn)|(cvs)|(svk))/o) {
     547if ($scheme =~ /^((svn)|(cvs)|(svk)|(git))/o) {
    548548    open(PIPE,"$vcscmd diff $dir |") || confess "Unable to get $vcscmd diff from $dir";
    549549    $l = 0;
     
    685685    # Either we have a version in the uri, and it should be the same
    686686    # as the one in the envar. Or we should add the version to the uri
    687     # # But not if it's git as it manages version branches internally
     687    # But not if it's git as it manages version branches internally
    688688    if ((basename($uri) ne basename($ENV{$envar})) && ($scheme !~ /^git/)) {
    689689        $uri .= "/".basename($ENV{$envar})
     
    704704        # remove schema from `git+file:` and `git+dir:` urls
    705705        # TODO: handle query-parameters
    706         $uri =~ s/^git\+(file|dir)://;
     706        $uri =~ s/^git\+(file|dir|ssh):[\/]*//;
    707707        # Expand potential env variable in it -- this is required due to the consistency check
    708708        $uri =~ s/(\$ENV.+\})/$1/eeg;
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r1958 r2022  
    8888my $tmp = $ENV{'PBROOTDIR'};
    8989$tmp =~ s|^$ENV{'PBCONFDIR'}/||;
     90# If no subdir, then replace again
     91$tmp =~ s|^$ENV{'PBCONFDIR'}||;
    9092
    9193#
     
    9496my $turl = "$pburl->{$ENV{'PBPROJ'}}/$tmp";
    9597$turl = $pburl->{$ENV{'PBPROJ'}} if ($scheme =~ /^(flat)|(ftp)|(http)|(file)|(git)\b/o);
    96 # gut svn is like svn
     98# git svn is like svn
    9799$turl = "$pburl->{$ENV{'PBPROJ'}}/$tmp"  if ($scheme =~ /^git\+svn/o);
    98100pb_vcs_compliant(undef,'PBDIR',"$ENV{'PBPROJDIR'}/$tmp",$turl,$pbinit);
Note: See TracChangeset for help on using the changeset viewer.