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

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

allow comments on changeset creation

File size: 837 bytes
RevLine 
[14945]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{
[16943]12    my $cs = Changeset::create($ARGV[1]);
[14945]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}
[16825]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}
[14945]36else
37{
[16943]38    print "usage: $0 {create [<comment>] | close <id> <comment>}\n";
[14945]39    exit;
40}
Note: See TracBrowser for help on using the repository browser.