summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README6
-rw-r--r--debian/changelog16
-rw-r--r--src/mozclient.mk.in4
-rw-r--r--src/mozclient/lib/MozClient/CVS.pm6
-rw-r--r--src/mozclient/lib/MozClient/Git.pm6
-rw-r--r--src/mozclient/lib/MozClient/Mercurial.pm7
-rw-r--r--src/mozclient/lib/MozClient/Subversion.pm6
-rw-r--r--src/mozclient/lib/MozClient/VCS.pm8
-rwxr-xr-xsrc/mozclient/mozclient.pl2
9 files changed, 57 insertions, 4 deletions
diff --git a/README b/README
index da439ad..8e4a57e 100644
--- a/README
+++ b/README
@@ -88,6 +88,12 @@ Optionally:
DEBIAN_KEEP_VCS to preserve the VCS files (*/CVS, .hg, ...)
ex: DEBIAN_KEEP_VCS=1
+LOCAL_BRANCH=/foo/bar/baz to point to a local branch instead of
+the configured remote one. It is faster if you have to publish
+tarballs quite often from this branch, such as daily snapshots.
+The local branch will be updated first.
+Note that the getdate are still remote so you need network connectivity.
+
Projects files are stored in /usr/share/mozilla-devscripts/mozclient
as .conf files. They contain the following parameters:
diff --git a/debian/changelog b/debian/changelog
index 1fe8890..4a04d9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,16 +1,24 @@
mozilla-devscripts (0.12) UNRELEASED; urgency=low
- * Remove "firefox" from MOZ_XPI_MOZILLA_DIRS in src/xpi.mk, adjust parameter
- description
- [ Fabien Tassin ]
* [ mozclient ]
- fix hg incorrectly requesting branches
- update src/mozclient/lib/MozClient/Mercurial.pm
- search the main nobin script in the system wide mozclient
path if we are building with a conf-dir and no script was found
- update src/mozclient/lib/MozClient/VCS.pm
+ - add support for local branches instead of the configured remote ones.
+ It is faster if you have to publish tarballs quite often from a branch,
+ such as when doing daily snapshots.
+ - update src/mozclient.mk.in
+ - update src/mozclient/lib/MozClient/{CVS,Git,Mercurial,Subversion,VCS}.pm
+ - update src/mozclient/mozclient.pl
+ - update README
+
+ [ Sasa Bodiroza <jazzva@gmail.com> ]
+ * Remove "firefox" from MOZ_XPI_MOZILLA_DIRS in src/xpi.mk, adjust parameter
+ description
- -- Sasa Bodiroza <jazzva@gmail.com> Fri, 16 Jan 2009 01:08:52 +0100
+ -- Fabien Tassin <fta@ubuntu.com> Mon, 19 Jan 2009 23:19:05 +0100
mozilla-devscripts (0.11) jaunty; urgency=low
diff --git a/src/mozclient.mk.in b/src/mozclient.mk.in
index a8b0c43..3d2955e 100644
--- a/src/mozclient.mk.in
+++ b/src/mozclient.mk.in
@@ -57,6 +57,10 @@ ifdef MOZCLIENT_PROJECTDIR
ARGS += -c $(MOZCLIENT_PROJECTDIR)
endif
+ifdef LOCAL_BRANCH
+ ARGS += -L $(LOCAL_BRANCH)
+endif
+
ifeq (,$(MOZCLIENT_PROJECTNAME))
$(error You must specify MOZCLIENT_PROJECTNAME)
endif
diff --git a/src/mozclient/lib/MozClient/CVS.pm b/src/mozclient/lib/MozClient/CVS.pm
index a7bd1b6..81cbb7c 100644
--- a/src/mozclient/lib/MozClient/CVS.pm
+++ b/src/mozclient/lib/MozClient/CVS.pm
@@ -129,6 +129,12 @@ sub checkout {
my $self = shift;
$self->LOG("MozClient:CVS::checkout:()");
+
+ if (defined $self->{'local-branch'}) {
+ confess "Can't MozClient::checkout() a local branch for " . $self->vcs;
+ # TODO: fix it if needed
+ }
+
$self->chdir($self->work_dir);
if (defined $self->{'MOZCLIENT_PROJECT'}) {
my $cmd = sprintf "make -f %s checkout MOZ_CO_PROJECT=%s %s %s",
diff --git a/src/mozclient/lib/MozClient/Git.pm b/src/mozclient/lib/MozClient/Git.pm
index 393032b..e160af3 100644
--- a/src/mozclient/lib/MozClient/Git.pm
+++ b/src/mozclient/lib/MozClient/Git.pm
@@ -23,6 +23,7 @@ package MozClient::Git;
use vars qw(@ISA);
use strict;
+use Carp;
use MozClient::VCS;
@ISA = ("MozClient::VCS");
@@ -66,6 +67,11 @@ sub checkout {
my $self = shift;
$self->LOG("MozClient:Git::checkout:()");
+
+ if (defined $self->{'local-branch'}) {
+ confess "Can't MozClient::checkout() a local branch for " . $self->vcs;
+ # TODO: fix it if needed
+ }
$self->chdir($self->work_dir);
my $modules = [];
if (defined $self->{'MOZCLIENT_PROJECT'}) {
diff --git a/src/mozclient/lib/MozClient/Mercurial.pm b/src/mozclient/lib/MozClient/Mercurial.pm
index 40f2879..f3c4527 100644
--- a/src/mozclient/lib/MozClient/Mercurial.pm
+++ b/src/mozclient/lib/MozClient/Mercurial.pm
@@ -66,6 +66,13 @@ sub checkout {
my $self = shift;
$self->LOG("MozClient:Mercurial::checkout:()");
+ if (defined $self->{'local-branch'}) {
+ chomp(my $cwd = `pwd`);
+ $self->chdir($self->{'local-branch'});
+ $self->run_system("hg pull");
+ $self->run_system("hg update");
+ $self->chdir($cwd);
+ }
$self->chdir($self->work_dir);
my $modules = [];
if (defined $self->{'MOZCLIENT_PROJECT'}) {
diff --git a/src/mozclient/lib/MozClient/Subversion.pm b/src/mozclient/lib/MozClient/Subversion.pm
index dc35564..0437a50 100644
--- a/src/mozclient/lib/MozClient/Subversion.pm
+++ b/src/mozclient/lib/MozClient/Subversion.pm
@@ -23,6 +23,7 @@ package MozClient::Subversion;
use vars qw(@ISA);
use strict;
+use Carp;
use MozClient::VCS;
@ISA = ("MozClient::VCS");
@@ -69,6 +70,11 @@ sub checkout {
$self->LOG("MozClient::Subversion::checkout:()");
+ if (defined $self->{'local-branch'}) {
+ confess "Can't MozClient::checkout() a local branch for " . $self->vcs;
+ # TODO: fix it if needed
+ }
+
$self->chdir($self->work_dir);
my $modules = [];
$self->{'MOZCLIENT_VCS_LOC'} .= "/" unless $self->{'MOZCLIENT_VCS_LOC'} =~ m,/$,;
diff --git a/src/mozclient/lib/MozClient/VCS.pm b/src/mozclient/lib/MozClient/VCS.pm
index 29963ec..4999cdc 100644
--- a/src/mozclient/lib/MozClient/VCS.pm
+++ b/src/mozclient/lib/MozClient/VCS.pm
@@ -63,6 +63,14 @@ sub new {
# The following options overwrite the conf files
$self->{'MOZCLIENT_EMBEDDED'} = 1 if $$opt{'embedded'};
$self->{'MOZ_CO_MODULE'} = $$opt{'modules'} if defined $$opt{'modules'};
+ if (defined $$opt{'local-branch'}) {
+ my $branch = $$opt{'local-branch'};
+ $self->{'local-branch'} = $branch;
+ $branch =~ s,/+$,,;
+ my ($repo, $dir) = $branch =~ m,(.*/)([^/]+)$,;
+ $self->{'MOZCLIENT_VCS_LOC'} = $repo;
+ $self->{'MOZCLIENT_PROJECT'} = $dir;
+ }
bless($self, $class);
$self;
diff --git a/src/mozclient/mozclient.pl b/src/mozclient/mozclient.pl
index d106231..746062e 100755
--- a/src/mozclient/mozclient.pl
+++ b/src/mozclient/mozclient.pl
@@ -79,6 +79,7 @@ mozclient [-l] project-name
--preserve-vcs|-p preserve VCS files
--embedded|-e create an embedded tarball
--modules|-m mods list of modules to fetch
+ --local-branch|-L branch use a local branch instead of the configured one
--debug|-D increase debug level
Examples:
@@ -188,6 +189,7 @@ GetOptions($opt,
'tag|t=s',
'embedded|e',
'modules|m=s',
+ 'local-branch|L=s',
'preserve-vcs|p') || &help();
&help() unless $#ARGV >= 0;