Changeset 420:6db6425f00a0 in finroc


Ignore:
Timestamp:
31.01.2022 08:21:12 (12 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
default
Phase:
public
Rebase:
63396234313564333039393131333565353035626362386330393730373863313134616532353034
Message:

Adds --change-logs command line option to finroc_update - making the more verbose output from the last changeset optional, as discussed.

Location:
scripts
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • scripts/finroc_update

    r417 r420  
    4949{ 
    5050    "-u <username>, --username=<username>" => "use <username> to get access to repositories", 
    51     "-p <password>, --password=<password>" => "use <password> to get access to repositories" 
     51    "-p <password>, --password=<password>" => "use <password> to get access to repositories", 
     52    "-c, --change-logs" => "print info and log messages for all incoming changesets", 
    5253}, undef; 
    5354 
    54 ParseCommandLine [ "username=s", "password=s" ], undef; 
     55ParseCommandLine [ "username=s", "password=s", "change-logs" ], undef; 
    5556 
    5657 
     
    9596my @heads; 
    9697my @check_dependencies; 
     98my $print_change_logs = GetCommandLineOption "change-logs"; 
    9799 
    98100ForEachWithProgress [ sort keys %directories ], \&EscapeFinrocHome, sub 
    99101{ 
    100102    my ($directory) = @_; 
    101     my $result = Update $directory, $username, $password; 
     103    my $result = Update $directory, $username, $password, $print_change_logs; 
    102104 
    103105    DEBUGMSG "Result: $result\n"; 
  • scripts/perl/FINROC/scm.pm

    r311 r420  
    8888} 
    8989 
    90 sub Update($$$) 
    91 { 
    92     my ($directory, $username, $password) = @_; 
     90sub Update($$$$) 
     91{ 
     92    my ($directory, $username, $password, $print_change_logs) = @_; 
    9393 
    9494    my $scm_name = GetSCMNameFromWorkingCopy $directory; 
     
    9999    $username = defined $username ? sprintf "'%s'", $username : "undef"; 
    100100    $password = defined $password ? sprintf "'%s'", $password : "undef"; 
    101  
    102     my $result; 
    103     eval sprintf "\$result = FINROC::scm::%s::Update(%s, %s, %s)", $scm_name, $directory, $username, $password; 
     101    $print_change_logs = defined $print_change_logs ? sprintf "'%s'", $print_change_logs : "0";     
     102 
     103    my $result; 
     104    eval sprintf "\$result = FINROC::scm::%s::Update(%s, %s, %s, %s)", $scm_name, $directory, $username, $password, $print_change_logs; 
    104105    ERRORMSG $@ if $@; 
    105106 
  • scripts/perl/FINROC/scm/hg.pm

    r419 r420  
    3131 
    3232use Env '$FINROC_HOME'; 
     33use open qw/:std :utf8/; 
    3334 
    3435use lib "$FINROC_HOME/scripts/perl"; 
     
    107108} 
    108109 
    109 sub Update($$$) 
    110 { 
    111     my ($directory, $username, $password) = @_; 
     110sub Update($$$$) 
     111{ 
     112    my ($directory, $username, $password, $print_change_logs) = @_; 
    112113 
    113114    my $default_path = GetPath $directory, "default"; 
     
    136137    $uncommitted_changes |= $output ne ""; 
    137138     
    138     $command = sprintf "hg %s --cwd \"%s\" in", $credentials, $directory; 
    139     DEBUGMSG sprintf "Executing '%s'\n", $command; 
    140     my $incoming_log = `$command`; 
     139    my $change_logs = ""; 
     140    if ($print_change_logs) 
     141    { 
     142        $command = sprintf "hg %s --cwd \"%s\" in", $credentials, $directory; 
     143        DEBUGMSG sprintf "Executing '%s'\n", $command; 
     144        $change_logs = `$command`; 
     145    } 
    141146         
    142147    $command = sprintf "hg %s --cwd \"%s\" pull -q", $credentials, $directory; 
     
    169174    return "Up to date" if $parent == $heads[0]; 
    170175     
    171     WARNMSG $incoming_log; 
     176    if ($print_change_logs) 
     177    { 
     178        WARNMSG $change_logs; 
     179    } 
    172180     
    173181    return "Uncommitted changes" if $uncommitted_changes; 
     
    258266    ERRORMSG sprintf "Command failed: %s\n", $command if $?; 
    259267 
    260     Update $directory, $username, $password; 
     268    Update $directory, $username, $password, 0; 
    261269} 
    262270 
  • scripts/perl/FINROC/scm/svn.pm

    r362 r420  
    6868} 
    6969 
    70 sub Update($$$) 
     70sub Update($$$$) 
    7171{ 
    72     my ($directory, $username, $password) = @_; 
     72    my ($directory, $username, $password, $print_change_logs) = @_; 
    7373 
    7474    my $credentials = CredentialsForCommandLine $username, $password; 
Note: See TracChangeset for help on using the changeset viewer.