Commit 97510bf2 authored by Michael Pyne's avatar Michael Pyne

bzr: Improve error messages a bit, and assume updates were by bzr.

- 'Internal' exceptions are only for things that are probably
kdesrc-build errors. They include an ugly backtrace. Normal errors
outside of kdesrc-build purview (including bzr's own errors) should just
be 'runtime' exceptions.
- We don't try to introspect from bzr how many changes (commits, files,
etc.) were made in a bzr pull. Mostly because I don't know best way to
do it. In this situation the most conservative thing to do is assume an
update was made, because if this code reports back that there were no
changes, kdesrc-build may not even try to rebuild the module.
parent 77de1292
Pipeline #10166 passed with stage
in 2 minutes and 5 seconds
......@@ -32,28 +32,25 @@ sub updateInternal
# check the source out into that directory.
my @cmd = ('bzr', 'branch', $bzrRepoName, $srcdir);
# Exceptions are used for failure conditions
if (log_command($module, 'bzr-branch', \@cmd) != 0) {
die make_exception('Internal', "Unable to checkout $module!");
croak_runtime("Unable to checkout $module!")
if log_command($module, 'bzr-branch', \@cmd) != 0;
# TODO: Filtering the output by passing a subroutine to log_command
# should give us the number of revisions, or we can just somehow
# count files.
my $newRevisionCount = 0;
my $newRevisionCount = 1;
return $newRevisionCount;
else {
# Update existing checkout. The source is currently in $srcdir
if (log_command($module, 'bzr-pull', ['bzr', 'pull']) != 0) {
die make_exception('Internal', "Unable to update $module!");
croak_runtime("Unable to update $module!")
if log_command($module, 'bzr-pull', ['bzr', 'pull']) != 0;
# I haven't looked at bzr up output yet to determine how to find
# number of affected files or number of revisions skipped.
my $changeCount = 0;
my $changeCount = 1;
return $changeCount;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment