mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-25 11:42:12 +01:00
Fix computation of files dict in Osc._commit
The old implementation was unable to commit specific files from packages, which have the same name, but belong to different projects.
This commit is contained in:
parent
194d179e66
commit
853ab4f758
@ -4634,10 +4634,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
for pac in pacs:
|
for pac in pacs:
|
||||||
path = os.path.normpath(os.path.join(pac.dir, os.pardir))
|
path = os.path.normpath(os.path.join(pac.dir, os.pardir))
|
||||||
if is_project_dir(path):
|
if is_project_dir(path):
|
||||||
pac_path = os.path.basename(os.path.normpath(pac.absdir))
|
# use this path construction for computing "pac_name",
|
||||||
prj_paths.setdefault(path, []).append(pac_path)
|
# because it is possible that pac.name != pac_name (e.g.
|
||||||
|
# for an external package wc)
|
||||||
|
pac_name = os.path.basename(os.path.normpath(pac.absdir))
|
||||||
|
prj_paths.setdefault(path, []).append(pac_name)
|
||||||
pac_objs.setdefault(path, []).append(pac)
|
pac_objs.setdefault(path, []).append(pac)
|
||||||
files[pac_path] = pac.todo
|
files.setdefault(path, {})[pac_name] = pac.todo
|
||||||
else:
|
else:
|
||||||
single_paths.append(pac.dir)
|
single_paths.append(pac.dir)
|
||||||
if not pac.todo:
|
if not pac.todo:
|
||||||
@ -4649,13 +4652,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
store_read_apiurl(pac, defaulturl=False)
|
store_read_apiurl(pac, defaulturl=False)
|
||||||
path = os.path.normpath(os.path.join(pac, os.pardir))
|
path = os.path.normpath(os.path.join(pac, os.pardir))
|
||||||
if is_project_dir(path):
|
if is_project_dir(path):
|
||||||
pac_path = os.path.normpath(os.path.abspath(pac))
|
pac_name = os.path.basename(os.path.normpath(os.path.abspath(pac)))
|
||||||
pac_name = os.path.basename(pac_path)
|
|
||||||
prj_paths.setdefault(path, []).append(pac_name)
|
prj_paths.setdefault(path, []).append(pac_name)
|
||||||
pac_objs.setdefault(path, [])
|
pac_objs.setdefault(path, [])
|
||||||
# wrt. the current implementation of Project.commit, this
|
# wrt. the current implementation of Project.commit, this
|
||||||
# actually not needed
|
# actually not needed
|
||||||
files[pac_name] = []
|
files.setdefault(path, {})[pac_name] = []
|
||||||
else:
|
else:
|
||||||
# fail with an appropriate error message
|
# fail with an appropriate error message
|
||||||
store_read_apiurl(pac, defaulturl=False)
|
store_read_apiurl(pac, defaulturl=False)
|
||||||
@ -4672,7 +4674,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if repl in('y', 'Y'):
|
if repl in('y', 'Y'):
|
||||||
can_branch = True
|
can_branch = True
|
||||||
|
|
||||||
prj.commit(packages, msg=msg, files=files, skip_local_service_run=skip_local_service_run, verbose=opts.verbose, can_branch=can_branch, force=opts.force)
|
prj_files = files[prj_path]
|
||||||
|
prj.commit(packages, msg=msg, files=prj_files, skip_local_service_run=skip_local_service_run, verbose=opts.verbose, can_branch=can_branch, force=opts.force)
|
||||||
store_unlink_file(prj.absdir, '_commit_msg')
|
store_unlink_file(prj.absdir, '_commit_msg')
|
||||||
for pac in single_paths:
|
for pac in single_paths:
|
||||||
p = Package(pac)
|
p = Package(pac)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user