source: subversion/applications/utils/revert/changeset.pl @ 16825

Last change on this file since 16825 was 16825, checked in by frederik, 10 years ago

add "upload" call for changesets

File size: 815 bytes
Line 
1#!/usr/bin/perl
2
3# Adapter script for Changeset.pm module
4# exports Changeset.pm functionality for command line use.
5
6use strict;
7use warnings;
8use Changeset;
9
10if ($ARGV[0] eq "create")
11{
12    my $cs = Changeset::create();
13    print "changeset created: $cs\n" if defined($cs);
14}
15elsif (($ARGV[0] eq "close") && (scalar(@ARGV)==3))
16{
17    if (Changeset::close($ARGV[1], $ARGV[2]))
18    {
19        print "changeset closed.\n";
20    }
21}
22elsif (($ARGV[0] eq "upload") && (scalar(@ARGV)==2))
23{
24    my $body = "";
25    while(<STDIN>) { $body .= $_; }
26    if (length($body) == 0)
27    {
28        print "usage: $0 upload <id> < content-to-upload\n";
29        exit;
30    }
31    if (Changeset::upload($ARGV[1], $body))
32    {
33        print "changeset uploaded.\n";
34    }
35}
36else
37{
38    print "usage: $0 {create|close <id> <comment>}\n";
39    exit;
40}
Note: See TracBrowser for help on using the repository browser.