1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 02:32:13 +01:00

Allow using directories as mv targets

Otherwise osc would crash because the target directory would be in use (in
case of ".".)
This commit is contained in:
Bogdano Arendartchuk 2013-02-27 18:38:03 -03:00
parent f9a718f662
commit 1d3805f30e
2 changed files with 3 additions and 0 deletions

1
NEWS
View File

@ -1,4 +1,5 @@
0.140
- allow specifying directories as mv targets
-
0.139

View File

@ -7638,6 +7638,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if not tgt_pkg:
raise oscerr.NoWorkingCopy("Error: \"%s\" does not point to an osc working copy." % os.path.abspath(dest))
if os.path.isfile(source) and os.path.isdir(dest):
dest = os.path.join(dest, os.path.basename(source))
os.rename(source, dest)
try:
tgt_pkg[0].addfile(os.path.basename(dest))