Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- do_update: rewrote code path for expanding/unexpanding a wc

The way for determining the revision was completely "wrong".
  • Loading branch information...
commit e2aa5cc65ccf6cdd90327ee829dc355f606a2090 1 parent 25c4cb1
@marcus-h marcus-h authored
Showing with 5 additions and 14 deletions.
  1. +2 −12 osc/
  2. +3 −2 osc/
14 osc/
@@ -4035,20 +4035,10 @@ def do_update(self, subcmd, opts, *args):
if not rev:
if opts.expand_link and p.islink() and not p.isexpanded():
- if p.haslinkerror():
- try:
- rev = show_upstream_xsrcmd5(p.apiurl, p.prjname,, revision=p.rev)
- except:
- rev = show_upstream_xsrcmd5(p.apiurl, p.prjname,, revision=p.rev, linkrev='base')
- p.mark_frozen()
- else:
- p.update(rev, opts.server_side_source_service_files, opts.limit_size)
- rev = p.linkinfo.xsrcmd5
+ rev = p.latest_rev(expand=True)
print 'Expanding to rev', rev
elif opts.unexpand_link and p.islink() and p.isexpanded():
- p.update(rev, opts.server_side_source_service_files, opts.limit_size)
- # XXX: calling update again is redundant (see below)
- rev = p.rev
+ rev = show_upstream_rev(p.apiurl, p.prjname,, meta=p.meta)
print 'Unexpanding to rev', rev
elif (p.islink() and p.isexpanded()) or opts.server_side_source_service_files:
rev = p.latest_rev(include_service_files=opts.server_side_source_service_files)
5 osc/
@@ -1820,10 +1820,11 @@ def unmark_frozen(self):
if os.path.exists(os.path.join(self.storedir, '_frozenlink')):
os.unlink(os.path.join(self.storedir, '_frozenlink'))
- def latest_rev(self, include_service_files=False):
+ def latest_rev(self, include_service_files=False, expand=False):
+ # if expand is True the xsrcmd5 will be returned (even if the wc is unexpanded)
if self.islinkrepair():
upstream_rev = show_upstream_xsrcmd5(self.apiurl, self.prjname,, linkrepair=1, meta=self.meta, include_service_files=include_service_files)
- elif self.islink() and self.isexpanded():
+ elif self.islink() and (self.isexpanded() or expand):
if self.isfrozen() or self.ispulled():
upstream_rev = show_upstream_xsrcmd5(self.apiurl, self.prjname,, linkrev=self.linkinfo.srcmd5, meta=self.meta, include_service_files=include_service_files)
Please sign in to comment.
Something went wrong with that request. Please try again.