1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +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', @cmdln.option('-c', '--current-dir', action='store_true',
help='place PACKAGE folder in the current directory' \ help='place PACKAGE folder in the current directory' \
'instead of a PROJECT/PACKAGE 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') @cmdln.alias('co')
def do_checkout(self, subcmd, opts, *args): 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 if opts.unexpand_link: expand_link = False
else: expand_link = True else: expand_link = True
if opts.source_service_files: service_file = True
else: service_file = False
args = slash_split(args) args = slash_split(args)
project = package = filename = None 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 if opts.current_dir: project_dir = None
checkout_package(apiurl, project, package, 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: elif project:
prj_dir = 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): for package in meta_get_packagelist(apiurl, project):
try: try:
checkout_package(apiurl, project, package, 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: except oscerr.LinkExpandError, e:
print >>sys.stderr, 'Link cannot be expanded:\n', e print >>sys.stderr, 'Link cannot be expanded:\n', e
print >>sys.stderr, 'Use "osc repairlink" for fixing merge conflicts:\n' print >>sys.stderr, 'Use "osc repairlink" for fixing merge conflicts:\n'
# check out in unexpanded form at least # check out in unexpanded form at least
checkout_package(apiurl, project, package, checkout_package(apiurl, project, package,
expand_link = False, prj_dir = prj_dir) expand_link = False, prj_dir = prj_dir, service_file = service_file)
else: else:
raise oscerr.WrongArgs('Missing argument.\n\n' \ raise oscerr.WrongArgs('Missing argument.\n\n' \

View File

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