1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-24 00:56:15 +01:00

Merge pull request #148 from lnussel/master

allow force commit
This commit is contained in:
Adrian Schröter 2015-08-13 07:50:58 +02:00
commit 3b203e67a9
2 changed files with 8 additions and 8 deletions

View File

@ -4453,7 +4453,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-F', '--file', metavar='FILE',
help='read log message from FILE, \'-\' denotes standard input.')
@cmdln.option('-f', '--force', default=False, action="store_true",
help='ignored')
help='force commit, even if there were no changes')
@cmdln.option('--skip-validation', default=False, action="store_true",
help='deprecated, don\'t use it')
@cmdln.option('-v', '--verbose', default=False, action="store_true",
@ -4552,13 +4552,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if repl in('y', 'Y'):
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)
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)
store_unlink_file(prj.absdir, '_commit_msg')
for pac in single_paths:
p = Package(pac)
if not msg and not opts.no_message:
msg = get_commit_msg(p.absdir, [p])
p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose)
p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose, force=opts.force)
store_unlink_file(p.absdir, '_commit_msg')
else:
for p in pacs:
@ -4567,7 +4567,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
p.todo.sort()
if not msg and not opts.no_message:
msg = get_commit_msg(p.absdir, [p])
p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose)
p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose, force=opts.force)
store_unlink_file(p.absdir, '_commit_msg')
@cmdln.option('-r', '--revision', metavar='REV',

View File

@ -918,7 +918,7 @@ class Project:
finally:
self.write_packages()
def commit(self, pacs = (), msg = '', files = {}, verbose = False, skip_local_service_run = False, can_branch=False):
def commit(self, pacs = (), msg = '', files = {}, verbose = False, skip_local_service_run = False, can_branch=False, force=False):
if len(pacs):
try:
for pac in pacs:
@ -937,7 +937,7 @@ class Project:
else:
p = Package(os.path.join(self.dir, pac))
p.todo = todo
p.commit(msg, verbose=verbose, skip_local_service_run=skip_local_service_run, can_branch=can_branch)
p.commit(msg, verbose=verbose, skip_local_service_run=skip_local_service_run, can_branch=can_branch, force=force)
elif pac in self.pacs_unvers and not is_package_dir(os.path.join(self.dir, pac)):
print('osc: \'%s\' is not under version control' % pac)
elif pac in self.pacs_broken:
@ -1355,7 +1355,7 @@ class Package:
todo.append(n.get('name'))
return todo
def commit(self, msg='', verbose=False, skip_local_service_run=False, can_branch=False):
def commit(self, msg='', verbose=False, skip_local_service_run=False, can_branch=False, force=False):
# commit only if the upstream revision is the same as the working copy's
upstream_rev = self.latest_rev()
if self.rev != upstream_rev:
@ -1427,7 +1427,7 @@ class Package:
% (filename, st))
todo_send[filename] = f.md5
if not real_send and not todo_delete and not self.islinkrepair() and not self.ispulled():
if not force and not real_send and not todo_delete and not self.islinkrepair() and not self.ispulled():
print('nothing to do for package %s' % self.name)
return 1