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

* keep _service: files local only.

This commit is contained in:
Adrian Schröter 2009-08-07 12:18:15 +00:00
parent b25b248a2e
commit f01be2f625
2 changed files with 17 additions and 12 deletions

View File

@ -1359,6 +1359,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-c', '--current-dir', action='store_true',
help='place PACKAGE folder in the current directory' \
'instead of a PROJECT/PACKAGE directory')
@cmdln.option('-s', '--source-service-files', action='store_true',
help='server side generated files of source services' \
'gets downloaded as well' )
@cmdln.alias('co')
def do_checkout(self, subcmd, opts, *args):
@ -1388,6 +1391,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.unexpand_link: expand_link = False
else: expand_link = True
if opts.source_service_files: service_file = True
else: service_file = False
args = slash_split(args)
project = package = filename = None
@ -1420,7 +1425,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.current_dir: project_dir = None
checkout_package(apiurl, project, package,
rev, expand_link=expand_link, prj_dir=project_dir)
rev, expand_link=expand_link, prj_dir=project_dir, service_file=service_file)
elif project:
prj_dir = project
@ -1439,13 +1444,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
for package in meta_get_packagelist(apiurl, project):
try:
checkout_package(apiurl, project, package,
expand_link = expand_link, prj_dir = prj_dir)
expand_link = expand_link, prj_dir = prj_dir, service_file = service_file)
except oscerr.LinkExpandError, e:
print >>sys.stderr, 'Link cannot be expanded:\n', e
print >>sys.stderr, 'Use "osc repairlink" for fixing merge conflicts:\n'
# check out in unexpanded form at least
checkout_package(apiurl, project, package,
expand_link = False, prj_dir = prj_dir)
expand_link = False, prj_dir = prj_dir, service_file = service_file)
else:
raise oscerr.WrongArgs('Missing argument.\n\n' \

View File

@ -752,7 +752,7 @@ class Package:
have_conflicts = False
for filename in self.todo:
if not filename.startswith('_service:'):
if not filename.startswith('_service:') and not filename.startswith('_service_'):
st = self.status(filename)
if st == 'A' or st == 'M':
self.todo_send.append(filename)
@ -829,11 +829,10 @@ class Package:
self.update_datastructs()
if self.filenamelist.count('_service'):
print 'The package contains a source service, update generated files from server...'
for filename in self.todo:
print 'The package contains a source service.'
for filename in self.todo:
if filename.startswith('_service:') and os.path.exists(filename):
os.unlink(filename)
self.update()
os.unlink(filename) #remove local files
def write_conflictlist(self):
if len(self.in_conflict) == 0:
@ -2707,7 +2706,7 @@ def make_dir(apiurl, project, package, pathname=None, prj_dir=None):
def checkout_package(apiurl, project, package,
revision=None, pathname=None, prj_obj=None,
expand_link=False, prj_dir=None):
expand_link=False, prj_dir=None, service_file=None):
try:
# the project we're in might be deleted.
@ -2742,9 +2741,10 @@ def checkout_package(apiurl, project, package,
p = Package(package)
for filename in p.filenamelist:
p.updatefile(filename, revision)
#print 'A ', os.path.join(project, package, filename)
print statfrmt('A', os.path.join(pathname, filename))
if service_file or not filename.startswith('_service:'):
p.updatefile(filename, revision)
#print 'A ', os.path.join(project, package, filename)
print statfrmt('A', os.path.join(pathname, filename))
if conf.config['do_package_tracking']:
# check if we can re-use an existing project object
if prj_obj == None: