On 2011-01-05, at 4:22 PM, Adrian Schröter wrote:
Am Mittwoch, 5. Januar 2011, 12:03:03 schrieb Anas Nashif:
any comments on this? Or is it so bad and not work commenting on? :)
hm, seems not to be complete to me. The api needs to create a new object, when you move it to a place where it does not exist. Maybe it would need to take over flags also.
All of this is done just like any other 'copypac' operation, the only difference is the revision file, which instead of starting from 0 will have the history from the source package.
Also some more data in the backend would need to added, like doing a commit and cloning the build counters.
That is what the patch below does. Anas
happy new year adrian
Anas
On 2010-12-23, at 1:39 AM, Anas Nashif wrote:
Hi,
so I gave it a try, spent 15 minutes and came up with this patch, which works for me (against 2.1 branch) :-) It is too easy to be true.
(of course this patch is missing the API changes which add keephist, but that is even more easier).
Any feedback? Anas
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@
copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'};
- my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
if ($autosimplifylink && !$autosimplifylink->{'rev'}) {
my $isbranch = grep {(keys %$_)[0] eq 'branch'} @{$autosimplifylink->{'patches'}->{''} || []};
@@ -5331,7 +5338,7 @@
'POST:/source/$project/$package cmd=linkdiff rev? linkrev? unified:bool?' => \&linkdiff, 'POST:/source/$project/$package cmd=commit rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool?' => \&sourcecommit, 'POST:/source/$project/$package cmd=commitfilelist rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool? requestid:num?' => \&sourcecommitfilelist,
- 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool?' => \&sourcecopy, + 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool? keephist:bool?' => \&sourcecopy,
'POST:/source/$project/$package cmd=branch rev? user:? comment:? orev:rev? oproject:project? opackage:package? olinkrev:linkrev? force:bool?' => \&sourcebranch, 'POST:/source/$project/$package cmd=linktobranch rev? user:? comment:? linkrev?' => \&linktobranch, 'POST:/source/$project/$package cmd=deleteuploadrev' => \&deleteuploadrev,
On 2010-12-22, at 3:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org