mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-05 19:00:56 +01:00
- default to expanded for new packages in osc up, like we do in osc co
This commit is contained in:
parent
151b9b699d
commit
b821c2ed6d
@ -2390,7 +2390,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
# (a) update all packages
|
# (a) update all packages
|
||||||
args += prj.pacs_have
|
args += prj.pacs_have
|
||||||
# (b) fetch new packages
|
# (b) fetch new packages
|
||||||
prj.checkout_missing_pacs(opts.expand_link)
|
prj.checkout_missing_pacs(expand_link = not opts.unexpand_link)
|
||||||
args.remove(arg)
|
args.remove(arg)
|
||||||
print_request_list(prj.apiurl, prj.name)
|
print_request_list(prj.apiurl, prj.name)
|
||||||
|
|
||||||
|
13
osc/core.py
13
osc/core.py
@ -509,12 +509,19 @@ class Project:
|
|||||||
if pac in self.pacs_broken:
|
if pac in self.pacs_broken:
|
||||||
if self.get_state(pac) != 'A':
|
if self.get_state(pac) != 'A':
|
||||||
checkout_package(self.apiurl, self.name, pac,
|
checkout_package(self.apiurl, self.name, pac,
|
||||||
pathname=getTransActPath(os.path.join(self.dir, pac)), prj_obj=self, prj_dir=self.dir, expand_link=expand_link)
|
pathname=getTransActPath(os.path.join(self.dir, pac)), prj_obj=self, prj_dir=self.dir, expand_link=not unexpand_link)
|
||||||
elif state == ' ':
|
elif state == ' ':
|
||||||
# do a simple update
|
# do a simple update
|
||||||
p = Package(os.path.join(self.dir, pac))
|
p = Package(os.path.join(self.dir, pac))
|
||||||
rev = None
|
rev = None
|
||||||
if expand_link and p.islink() and not p.isexpanded():
|
if expand_link and p.islink() and not p.isexpanded():
|
||||||
|
if p.haslinkerror():
|
||||||
|
try:
|
||||||
|
rev = show_upstream_xsrcmd5(p.apiurl, p.prjname, p.name, revision=p.rev)
|
||||||
|
except:
|
||||||
|
rev = show_upstream_xsrcmd5(p.apiurl, p.prjname, p.name, revision=p.rev, linkrev="base")
|
||||||
|
p.mark_frozen()
|
||||||
|
else:
|
||||||
rev = p.linkinfo.xsrcmd5
|
rev = p.linkinfo.xsrcmd5
|
||||||
print 'Expanding to rev', rev
|
print 'Expanding to rev', rev
|
||||||
elif unexpand_link and p.islink() and p.isexpanded():
|
elif unexpand_link and p.islink() and p.isexpanded():
|
||||||
@ -524,6 +531,8 @@ class Project:
|
|||||||
rev = p.latest_rev()
|
rev = p.latest_rev()
|
||||||
print 'Updating %s' % p.name
|
print 'Updating %s' % p.name
|
||||||
p.update(rev, service_files)
|
p.update(rev, service_files)
|
||||||
|
if unexpand_link:
|
||||||
|
p.unmark_frozen()
|
||||||
elif state == 'D':
|
elif state == 'D':
|
||||||
# TODO: Package::update has to fixed to behave like svn does
|
# TODO: Package::update has to fixed to behave like svn does
|
||||||
if pac in self.pacs_broken:
|
if pac in self.pacs_broken:
|
||||||
@ -541,7 +550,7 @@ class Project:
|
|||||||
else:
|
else:
|
||||||
print 'unexpected state.. package \'%s\'' % pac
|
print 'unexpected state.. package \'%s\'' % pac
|
||||||
|
|
||||||
self.checkout_missing_pacs()
|
self.checkout_missing_pacs(expand_link=not unexpand_link)
|
||||||
finally:
|
finally:
|
||||||
self.write_packages()
|
self.write_packages()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user