Changeset f7f894d in lab.git for Dev


Ignore:
Timestamp:
Aug 21, 2013 12:56:22 PM (11 years ago)
Author:
Ken-ichi Mito <mitty@…>
Branches:
master
Children:
13e2400
Parents:
9353238
Message:

change messages, add sample script

Location:
Dev/github
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/github/GitHubBackup.pm

    r9353238 rf7f894d  
    194194} 
    195195 
     196sub message { 
     197    my $self = shift; 
     198    my $message  = shift; 
     199     
     200    print $self->full_name, " $message\n"; 
     201     
     202    return $self; 
     203} 
     204 
    196205sub sync { 
    197206    my $self = shift; 
     
    201210    if (-d "$dir") { 
    202211        local $CWD = $dir; 
    203         print "fetch $dir\n"; 
     212        $self->message("++> $dir"); 
    204213        Git::Repository->run(fetch => '--all'); 
    205214        return $self; 
    206215    } 
    207216     
    208     print "clone $dir\n"; 
     217    $self->message("==> $dir"); 
    209218    mkpath $dir; 
    210219    Git::Repository->run(clone => '--mirror' => $url => $dir); 
     
    243252    foreach my $fork (@{$self->forks}) { 
    244253        if ($remotes =~ /$fork->{full_name}/) { 
    245             print "skip ", $fork->{full_name}, "\n"; 
     254            $self->message("--- ". $fork->{full_name}); 
    246255            next; 
    247256        } 
    248         print "add ", $fork->{full_name}, "\n"; 
     257        $self->message("+++ ". $fork->{full_name}); 
    249258        Git::Repository->run(remote => add => $fork->{full_name} => $fork->{clone_url}); 
    250259        push @fetch, $fork->{full_name}; 
     
    252261     
    253262    foreach my $fork (@fetch) { 
    254         print "fetch $fork\n"; 
     263        $self->message("--> $fork"); 
    255264        Git::Repository->run(fetch => $fork); 
    256265    } 
     
    270279    ); 
    271280    if ($res->code != 200) { 
    272         print "$dir does not exist\n"; 
     281        $self->message("wiki does not exist"); 
    273282        return $self; 
    274283    } 
     
    303312    foreach my $issue (@{$self->issues}) { 
    304313        my $number = $issue->{number}; 
    305         print "save issue/$number\n"; 
     314        $self->message("+++ issue/$number"); 
    306315         
    307316        open my $fh, ">$number.json"; 
Note: See TracChangeset for help on using the changeset viewer.