mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 18:06:13 +01:00
- todo_send and todo_delete are no longer attributes (this also fixes commit ca45955ad60fc1dac9b013ba2d7cecbb9a132c6e)
This commit is contained in:
parent
334fa82d39
commit
7ca255cca0
18
osc/core.py
18
osc/core.py
@ -789,8 +789,6 @@ class Package:
|
|||||||
self.update_datastructs()
|
self.update_datastructs()
|
||||||
|
|
||||||
self.todo = []
|
self.todo = []
|
||||||
self.todo_send = []
|
|
||||||
self.todo_delete = []
|
|
||||||
|
|
||||||
def info(self):
|
def info(self):
|
||||||
source_url = makeurl(self.apiurl, ['source', self.prjname, self.name])
|
source_url = makeurl(self.apiurl, ['source', self.prjname, self.name])
|
||||||
@ -905,6 +903,8 @@ class Package:
|
|||||||
shutil.copyfile(os.path.join(self.dir, n), os.path.join(self.storedir, n))
|
shutil.copyfile(os.path.join(self.dir, n), os.path.join(self.storedir, n))
|
||||||
|
|
||||||
def commit(self, msg='', validators=None, verbose_validation=None):
|
def commit(self, msg='', validators=None, verbose_validation=None):
|
||||||
|
todo_send = []
|
||||||
|
todo_delete = []
|
||||||
# commit only if the upstream revision is the same as the working copy's
|
# commit only if the upstream revision is the same as the working copy's
|
||||||
upstream_rev = self.latest_rev()
|
upstream_rev = self.latest_rev()
|
||||||
if self.rev != upstream_rev:
|
if self.rev != upstream_rev:
|
||||||
@ -936,13 +936,11 @@ class Package:
|
|||||||
for filename in self.todo:
|
for filename in self.todo:
|
||||||
if not filename.startswith('_service:') and not filename.startswith('_service_'):
|
if not filename.startswith('_service:') and not filename.startswith('_service_'):
|
||||||
st = self.status(filename)
|
st = self.status(filename)
|
||||||
if st == 'S':
|
if st == 'A' or st == 'M':
|
||||||
self.todo.remove(filename)
|
todo_send.append(filename)
|
||||||
elif st == 'A' or st == 'M':
|
|
||||||
self.todo_send.append(filename)
|
|
||||||
print statfrmt('Sending', os.path.join(pathn, filename))
|
print statfrmt('Sending', os.path.join(pathn, filename))
|
||||||
elif st == 'D':
|
elif st == 'D':
|
||||||
self.todo_delete.append(filename)
|
todo_delete.append(filename)
|
||||||
print statfrmt('Deleting', os.path.join(pathn, filename))
|
print statfrmt('Deleting', os.path.join(pathn, filename))
|
||||||
elif st == 'C':
|
elif st == 'C':
|
||||||
have_conflicts = True
|
have_conflicts = True
|
||||||
@ -951,7 +949,7 @@ class Package:
|
|||||||
print 'Please resolve all conflicts before committing using "osc resolved FILE"!'
|
print 'Please resolve all conflicts before committing using "osc resolved FILE"!'
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if not self.todo_send and not self.todo_delete and not self.rev == "upload" and not self.islinkrepair() and not self.ispulled():
|
if not todo_send and not todo_delete and not self.rev == "upload" and not self.islinkrepair() and not self.ispulled():
|
||||||
print 'nothing to do for package %s' % self.name
|
print 'nothing to do for package %s' % self.name
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@ -964,12 +962,12 @@ class Package:
|
|||||||
|
|
||||||
print 'Transmitting file data ',
|
print 'Transmitting file data ',
|
||||||
try:
|
try:
|
||||||
for filename in self.todo_delete:
|
for filename in todo_delete:
|
||||||
# do not touch local files on commit --
|
# do not touch local files on commit --
|
||||||
# delete remotely instead
|
# delete remotely instead
|
||||||
self.delete_remote_source_file(filename)
|
self.delete_remote_source_file(filename)
|
||||||
self.to_be_deleted.remove(filename)
|
self.to_be_deleted.remove(filename)
|
||||||
for filename in self.todo_send:
|
for filename in todo_send:
|
||||||
sys.stdout.write('.')
|
sys.stdout.write('.')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
self.put_source_file(filename)
|
self.put_source_file(filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user