X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/1cccf09a6874e53fb8c28bf5d89b0b51c917942a..85ecfb40a19334d7ea53de8b982915eff3cae07d:/mr diff --git a/mr b/mr index 620ad7f..b5d5c11 100755 --- a/mr +++ b/mr @@ -787,6 +787,13 @@ sub repolist { } @list; } +sub repodir { + my $repo=shift; + my $topdir=$repo->{topdir}; + my $subdir=$repo->{subdir}; + return abs_path(($subdir =~/^\//) ? $subdir : $topdir.$subdir); +} + # figure out which repos to act on sub selectrepos { my @repos; @@ -795,7 +802,7 @@ sub selectrepos { my $subdir=$repo->{subdir}; next if $subdir eq 'DEFAULT'; - my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir; + my $dir=repodir($repo); my $d=$directory; $dir.="/" unless $dir=~/\/$/; $d.="/" unless $d=~/\/$/; @@ -815,7 +822,7 @@ sub selectrepos { my $subdir=$repo->{subdir}; next if $subdir eq 'DEFAULT'; - my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir; + my $dir=repodir($repo); my $d=$directory; $dir.="/" unless $dir=~/\/$/; $d.="/" unless $d=~/\/$/;