Mailinglist Archive: opensuse-buildservice (158 mails)

< Previous Next >
Re: [opensuse-buildservice] Moving a package to another project maintaining history (and Release.Build)
  • From: Anas Nashif <nashif@xxxxxxxxxxxxxxx>
  • Date: Thu, 23 Dec 2010 01:39:12 +0000
  • Message-id: <C322D572-6ED3-4D4B-9733-76E974E584CF@xxxxxxxxxxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx


--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
References