source: subversion/applications/utils/revert/undo.pl @ 17935

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

first version of perl tools for undo/revert

File size: 760 bytes
Line 
1#!/usr/bin/perl
2
3# Adapter script for Undo.pm module
4# exports Undo.pm functionality for command line use.
5
6use strict;
7use warnings;
8use Undo;
9
10if (scalar(@ARGV) != 4 || $ARGV[0] !~ /^(node|way|relation)$/)
11{
12    print <<EOF;
13usage: $0 <node|way|relation> <id> <username|changeset> <changeset>
14
15where
16  id : OSM id of the object to revert
17  username, changeset : username (alphanumeric) or changeset (numeric)
18     of the change to revert
19  changeset : id of changeset to use for revert action
20EOF
21    exit;
22}
23
24my ($what, $id, $undo_what, $changeset) = @ARGV;
25
26my $undo_user;
27my $undo_changeset;
28
29if ($undo_what =~ /^\d+$/) { $undo_changeset=$undo_what; } else { $undo_user = $undo_what; }
30
31Undo::undo($what, $id, $undo_user, $undo_changeset, $changeset);
32
Note: See TracBrowser for help on using the repository browser.