[opensuse-buildservice] Re: [PATCH] - do_update: rewrote code path for expanding/unexpanding a wc
On Wed, Mar 28, 2012 at 10:45:34PM +0200, OBS osc wrote:
From: Marcus Huewe <suse-tux@gmx.de>
The way for determining the revision was completely "wrong". [...] - rev = show_upstream_xsrcmd5(p.apiurl, p.prjname, p.name, 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, p.name, meta=p.meta) print 'Unexpanding to rev', rev
That can't work if you didn't check out the latest version, but some older rev. Really, you can check out an expanded link (by supplying the xsrcmd5) and then it should be possible to switch to the unexpanded view. That's what the linkrev's lsrcmd5 is for. If you're not using it you're doing somethink wrong ;) Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 2012-03-29 12:20:34 +0200, Michael Schroeder wrote:
On Wed, Mar 28, 2012 at 10:45:34PM +0200, OBS osc wrote:
From: Marcus Huewe <suse-tux@gmx.de>
The way for determining the revision was completely "wrong". [...] - rev = show_upstream_xsrcmd5(p.apiurl, p.prjname, p.name, 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, p.name, meta=p.meta) print 'Unexpanding to rev', rev
That can't work if you didn't check out the latest version, but some older rev.
Really, you can check out an expanded link (by supplying the xsrcmd5) and then it should be possible to switch to the unexpanded view. That's what the linkrev's lsrcmd5 is for. If you're not using it you're doing somethink wrong ;)
IMHO it's a semantic question: what is "osc up -e" and "osc up -u" supposed to do? The old behaviour was: "osc up -e": update to the latest rev and expand it "osc up -u": update to the current rev and don't expand it That behaviour is (IMHO) inconsistent. Therefore I changed it to: "osc up -e": update to the latest rev and expand it "osc up -u": update to the latest rev and don't expand it In the latter case the "show_upstream_rev" should be ok (the "plain" rev returned by show_upstream_rev and the lsrcmd5 refer to the same "entity") or am I wrong? Now the question is: what is the expected behaviour for "osc up -u/-e"? Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Thu, Mar 29, 2012 at 01:22:27PM +0200, Marcus Hüwe wrote:
IMHO it's a semantic question: what is "osc up -e" and "osc up -u" supposed to do? The old behaviour was: "osc up -e": update to the latest rev and expand it "osc up -u": update to the current rev and don't expand it
Dunno, I always thought it was: "osc up -e": keep the current rev, but expand "osc up -u": keep the current rev, but unexpand I that's no longer true, we need to provide the functionality in some way. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 2012-03-29 14:22:24 +0200, Michael Schroeder wrote:
On Thu, Mar 29, 2012 at 01:22:27PM +0200, Marcus Hüwe wrote:
IMHO it's a semantic question: what is "osc up -e" and "osc up -u" supposed to do? The old behaviour was: "osc up -e": update to the latest rev and expand it "osc up -u": update to the current rev and don't expand it
Hrm I just realized that this is wrong. Even the old code (before commit 081037e9137a74fd36f18b15bf9e0f18203d49fd) checked out the latest rev (in both cases) and expands it (if -e was specified).
Dunno, I always thought it was:
"osc up -e": keep the current rev, but expand "osc up -u": keep the current rev, but unexpand
I that's no longer true, we need to provide the functionality in some way.
This was changed in commit beae2c0cdd7da60e595ff43d66f484f94dded6c0 (in 2010). What do you think, should we keep the current behaviour or restore the "original" one? Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (2)
-
Marcus Hüwe
-
Michael Schroeder