add a checkout handler that defaults the working copy path to the last directory component before "/trunk"
This commit is contained in:
parent
40b987911c
commit
3456e95135
4
README
4
README
@ -35,6 +35,10 @@ Implemented subcommands:
|
|||||||
or a tag or branch name)
|
or a tag or branch name)
|
||||||
- if <source> is not given the HEAD of the current working-copy URL is used.
|
- if <source> is not given the HEAD of the current working-copy URL is used.
|
||||||
- also switch to the new branch if -s is given
|
- 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...]
|
clean [-x] {-n|-f} [path...]
|
||||||
- remove (or list) unversioned items
|
- remove (or list) unversioned items
|
||||||
options:
|
options:
|
||||||
|
7
jsvn
7
jsvn
@ -1650,6 +1650,12 @@ def url_h(argv, svn, out, config):
|
|||||||
out.write(get_svn_url(svn, path) + '\n')
|
out.write(get_svn_url(svn, path) + '\n')
|
||||||
return RET_OK
|
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):
|
def clean_h(argv, svn, out, config):
|
||||||
argv = argv[1:] # strip command
|
argv = argv[1:] # strip command
|
||||||
opts, args = getopt.getopt(argv, 'fnx',
|
opts, args = getopt.getopt(argv, 'fnx',
|
||||||
@ -1787,6 +1793,7 @@ def do_cmd(argv, realsvn, config, expand=True):
|
|||||||
'add': add_h,
|
'add': add_h,
|
||||||
'bisect': bisect_h,
|
'bisect': bisect_h,
|
||||||
'branch': branch_h,
|
'branch': branch_h,
|
||||||
|
'checkout': checkout_h,
|
||||||
'clean': clean_h,
|
'clean': clean_h,
|
||||||
'externals': externals_h,
|
'externals': externals_h,
|
||||||
'switch': switch_h,
|
'switch': switch_h,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user