Merge lp:~roadmr/isitdeployable/handle-nonexistent-revisions-in-bzr into lp:isitdeployable

Proposed by Daniel Manrique
Status: Merged
Approved by: Daniel Manrique
Approved revision: 297
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~roadmr/isitdeployable/handle-nonexistent-revisions-in-bzr
Merge into: lp:isitdeployable
Diff against target: 19 lines (+7/-1)
1 file modified
revtracker/tasks.py (+7/-1)
To merge this branch: bzr merge lp:~roadmr/isitdeployable/handle-nonexistent-revisions-in-bzr
Reviewer Review Type Date Requested Status
Jonathan Hartley (community) Approve
Maximiliano Bertacchini Approve
Review via email: mp+370522@code.launchpad.net

Commit message

Handle nonexistent revisions properly.

This happens if (that we know of):

1- A branch has been rewritten and a specific commit referenced in the project is gone or nonexistent due to a typo :)

Description of the change

Handle nonexistent revisions properly.

This happens if (that we know of):

1- A branch has been rewritten and a specific commit referenced in the project is gone or nonexistent due to a typo :)

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Explaining myself

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Lgtm! (check indentation nitpick)

review: Approve
298. By Daniel Manrique

Fix indentation

Revision history for this message
Jonathan Hartley (tartley) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'revtracker/tasks.py'
2--- revtracker/tasks.py 2019-07-23 13:23:37 +0000
3+++ revtracker/tasks.py 2019-07-23 20:41:01 +0000
4@@ -240,8 +240,14 @@
5 if revspec is None:
6 return None
7 if self.vcs == VCS.VCS_BAZAAR:
8- revid = RevisionSpec.from_string(revspec).as_revision_id(
9+ try:
10+ revid = RevisionSpec.from_string(revspec).as_revision_id(
11 self.branch)
12+ except brz_errors.InvalidRevisionSpec as err:
13+ print("%s - trying to get revspec %s from branch %s. "
14+ "Returning None" % (
15+ err, revspec, self.branch))
16+ return None # Revision not found in the branch
17 else:
18 try:
19 revid = self.branch.revparse_single(revspec).id.hex

Subscribers

People subscribed via source and target branches