"Unable to branch" error message could be more informative

Bug #1540529 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju
Confirmed
Medium
Unassigned

Bug Description

I was trying to create a workspace using the following command:

$ mojo workspace-new --series trusty --stage ue/mojo-ue-ci-train/devel/ -p mojo-stg-ue-ci-train ~/source-trees/canonical-mojo-specs/trunk/ue/mojo-ue-ci-train devel
2016-02-01 10:30:41 [INFO] Using pre-existing container class containerless
Unable to branch /home/bdmurray/source-trees/canonical-mojo-specs/trunk/ue/mojo-ue-ci-train
Please check the branch exists and you have permissions to access it

I seems that my spec url directory too specific and I really wanted:

~/source-trees/canonical-mojo-specs/trunk

However, the error message I received from mojo was not helpful in figuring this out. It looks like cli.py logs this error message on an AttributeError and returns information about spec_url, however the error really happens in project.py where I think spec_url is concatenated with another mojo option. Subsequently, I think it'd be more helpful if the error came from project.py so the error message included the fully generated path and was more informative.

Revision history for this message
Tom Haddon (mthaddon) wrote :

The message "Unable to branch /home/bdmurray/source-trees/canonical-mojo-specs/trunk/ue/mojo-ue-ci-train" does seem to be the fully generate path you passed in here. Can you clarify what message you would like to have seen to make it clearer? Maybe "Please check that the branch exists, is the root of the branch and you have permissions to access it"? Or something that tells you what the root of the branch is if you specify a directory within a branch?

Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

I expect the behavior will change if the code changes from https://code.launchpad.net/~timkuhlman/mojo/codetree/+merge/285255 are merged.

Revision history for this message
Brian Murray (brian-murray) wrote :

I guess the path "/home/bdmurray/source-trees/canonical-mojo-specs/trunk/ue/mojo-ue-ci-train" not being a branch is confusing to me because it is a subdirectory in a branch. bzr info seems to know that the directory is a part of a branch:

 $ bzr info /home/bdmurray/source-trees/canonical-mojo-specs/trunk/ue/mojo-ue-ci-train
Standalone tree (format: 2a)
Location:
  branch root: /home/bdmurray/source-trees/canonical-mojo-specs/trunk

Related branches:
  parent branch: bzr+ssh://bazaar.launchpad.net/+branch/canonical-mojo-specs/

Perhaps that information could be used to generate a more informative error message.

Tom Haddon (mthaddon)
Changed in mojo:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.