Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

OTWO-1412 #3

Merged
merged 1 commit into from

2 participants

@robinluckey

We can't know when it's required, but it's fatal to miss it, so we force a bzr upgrade after every pull.

This patch fixes the SlocJobs that crash with "Broken pipe" errors, as well as the SlocJobs that hang forever. Both of these problems are caused by local repositories that require a format upgrade.

@robinluckey robinluckey OTWO-1412 Upgrades Bzr repositories after every pull
We can't know when it's required, but it's fatal to miss it,
So we force a `bzr upgrade` after every pull.
68b9ecc
@amujumdar amujumdar merged commit 3b24ee8 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 9, 2012
  1. @robinluckey

    OTWO-1412 Upgrades Bzr repositories after every pull

    robinluckey authored
    We can't know when it's required, but it's fatal to miss it,
    So we force a `bzr upgrade` after every pull.
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/scm/adapters/bzr/pull.rb
View
16 lib/scm/adapters/bzr/pull.rb
@@ -11,6 +11,7 @@ def pull(from, &block)
run "mkdir -p '#{self.url}'"
run "rm -rf '#{self.url}'"
run "bzr branch '#{from.url}' '#{self.url}'"
+ clean_up_disk
else
run "cd '#{self.url}' && bzr revert && bzr pull --overwrite '#{from.url}'"
end
@@ -18,5 +19,20 @@ def pull(from, &block)
yield(1,1) if block_given? # Progress bar callback
end
+ def clean_up_disk
+ # Usually a `bzr upgrade` is unnecessary, but it's fatal to miss it when
+ # required. Because I don't know how to detect in advance whether we
+ # actually need it, we play it safe and always upgrade.
+ #
+ # Unfortunately, not only can we not know whether it is required,
+ # but the command fails and raises when the upgrade is not required.
+
+ begin
+ run "cd '#{self.url}' && bzr upgrade"
+ rescue RuntimeError => e
+ raise unless e.message =~ /already at the most recent format/
+ end
+ end
+
end
end
Something went wrong with that request. Please try again.