1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 23:16:14 +01:00

- commit: check if "_pulled" file exists before removing it

- fixed indention
This commit is contained in:
Marcus Huewe 2009-12-17 20:20:35 +01:00
parent 6ca8d75fa7
commit b983f116eb
2 changed files with 25 additions and 25 deletions

View File

@ -4368,20 +4368,19 @@ Please submit there instead, or use --nodevelproject to force direct submission.
"""
if not is_package_dir('.'):
raise oscerr.NoWorkingCopy("Error: \"%s\" is not an osc working copy." % os.path.abspath("."))
raise oscerr.NoWorkingCopy('Error: \'%s\' is not an osc working copy.' % os.path.abspath('.'))
p = Package('.')
# check if everything is committed
for filename in p.filenamelist:
st = p.status(filename)
if st != ' ':
if p.status(filename) != ' ':
raise oscerr.WrongArgs('Please commit your local changes first!')
# check if we need to update
upstream_rev = p.latest_rev()
if p.rev != upstream_rev:
raise oscerr.WorkingCopyOutdated((p.absdir, p.rev, upstream_rev))
if not p.islink():
elif not p.islink():
raise oscerr.WrongArgs('osc pull only works on linked packages.')
if not p.isexpanded():
elif not p.isexpanded():
raise oscerr.WrongArgs('osc pull only works on expanded links.')
# hack

View File

@ -878,6 +878,7 @@ class Package:
print
print 'Committed revision %s.' % self.rev
if self.ispulled():
os.unlink(os.path.join(self.storedir, '_pulled'))
if self.islinkrepair():
os.unlink(os.path.join(self.storedir, '_linkrepair'))