Created
August 9, 2011 12:06
-
-
Save k12u/1133872 to your computer and use it in GitHub Desktop.
svn ls helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
#use warnings; | |
use Getopt::Std; | |
my $svn_info = `svn info|grep URL`; | |
die "not http repository: $svn_info" unless $svn_info =~ /^URL: https?.+$/sm; | |
die "trunk/branches directory not found in svn info: $svn_info" unless $svn_info =~ m#^URL: https?.+/(branches|tags|trunk)#sm; | |
my ($root_path) = (($svn_info =~ m#^URL: (https?.+/)(branches|tags|trunk).*$#sm)[0]); | |
my $sub_dir = (($ARGV[0] eq "-t") ? "tags/" : "branches/"); | |
my $cmd = sprintf("svn ls --verbose %s\n", ($root_path . $sub_dir)); | |
print `$cmd`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment