diff --git a/README b/README index d909b23..e6abb53 100644 --- a/README +++ b/README @@ -35,6 +35,10 @@ Implemented subcommands: or a tag or branch name) - if is not given the HEAD of the current working-copy URL is used. - also switch to the new branch if -s is given + checkout [options] [url] [wc_path] + - if a URL is given that ends with /trunk and no working copy path is given, + then the last directory component before "/trunk" is used as the working + copy path clean [-x] {-n|-f} [path...] - remove (or list) unversioned items options: diff --git a/jsvn b/jsvn index eac41a2..8c660e2 100755 --- a/jsvn +++ b/jsvn @@ -1650,6 +1650,12 @@ def url_h(argv, svn, out, config): out.write(get_svn_url(svn, path) + '\n') return RET_OK +def checkout_h(argv, svn, out, config): + if re.search(r'://.*/trunk$', argv[-1]): + argv += [argv[-1].split("/")[-2]] + Popen([svn] + argv, stdout=out).wait() + return RET_OK + def clean_h(argv, svn, out, config): argv = argv[1:] # strip command opts, args = getopt.getopt(argv, 'fnx', @@ -1787,6 +1793,7 @@ def do_cmd(argv, realsvn, config, expand=True): 'add': add_h, 'bisect': bisect_h, 'branch': branch_h, + 'checkout': checkout_h, 'clean': clean_h, 'externals': externals_h, 'switch': switch_h,