mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-24 19:22:13 +01:00
osc mv command
This commit is contained in:
parent
aafcf707fd
commit
e57b3548c9
1
NEWS
1
NEWS
@ -19,6 +19,7 @@
|
|||||||
have changed and submits only the changed after asking back.
|
have changed and submits only the changed after asking back.
|
||||||
- show worker/id on jobhistory and make it faster by adding a default limit of 20
|
- show worker/id on jobhistory and make it faster by adding a default limit of 20
|
||||||
- add "osc build --root" option to allow to specify build root directory
|
- add "osc build --root" option to allow to specify build root directory
|
||||||
|
- added osc mv command which can rename file and leave him under version control
|
||||||
#
|
#
|
||||||
# Features which require OBS 1.7
|
# Features which require OBS 1.7
|
||||||
#
|
#
|
||||||
|
@ -4339,6 +4339,28 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
vc.wait()
|
vc.wait()
|
||||||
sys.exit(vc.returncode)
|
sys.exit(vc.returncode)
|
||||||
|
|
||||||
|
@cmdln.option('-f', '--force', action='store_true',
|
||||||
|
help='forces removal of entire package and its files')
|
||||||
|
def do_mv(self, subcmd, opts, source, dest):
|
||||||
|
"""${cmd_name}: Move SOURCE file to DEST and keep it under version control
|
||||||
|
|
||||||
|
${cmd_usage}
|
||||||
|
${cmd_option_list}
|
||||||
|
"""
|
||||||
|
|
||||||
|
if not os.path.isfile(source):
|
||||||
|
raise oscerr.WrongArgs("Source file ``%s'' does not exists" % source)
|
||||||
|
if not opts.force and os.path.isfile(dest):
|
||||||
|
raise oscerr.WrongArgs("Dest file ``%s'' already exists" % dest)
|
||||||
|
if not is_package_dir('.'):
|
||||||
|
raise oscerr.NoWorkingCopy("Error: \"%s\" is not an osc working copy." % os.path.abspath(dir))
|
||||||
|
|
||||||
|
p = findpacs('.')[0]
|
||||||
|
os.rename(source, dest)
|
||||||
|
self.do_add(subcmd, opts, dest)
|
||||||
|
self.do_delete(subcmd, opts, source)
|
||||||
|
|
||||||
|
|
||||||
# fini!
|
# fini!
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user