BRANCH_NAME for sub projects evaluates to "root branch"?

Asked by Bradley Friedman

take the following command as an example:

bzr pcmd -v --dry-run "send -o \"{PROJECT_ROOT}\\changeset_build\\{BRANCH_NAME}\" {BRANCH_URL}"

note the generated commands for both the actual project root and a subproject:

# Component: root
# Run command: bzr send -o "C:/Users/localadmin/Documents/bzr_branches/fiecom_changesets/\\changeset_build\\
root branch" bzr+ssh://bazaar.launchpad.net/%2Bbranch/fiecom/

# Component: fiecac
# Entering directory `fiecac'
# Run command: bzr send -o "C:/Users/localadmin/Documents/bzr_branches/fiecom_changesets/\\changeset_build\\
root branch" bzr+ssh://bazaar.launchpad.net/%2Bbranch/fiecac/

I'd expect either, for the "{PROJECT_ROOT}" to change to match the new root of the subproject, or for the {BRANCH_NAME} to change for the subproject based on its name. Instead, they go to the same location, and they use the same default name of "root branch".

Is this a bug? Or am I perhaps doing something incorrect here?

Question information

Language:
English Edit question
Status:
Answered
For:
ScmProj plugin Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alexander Belchenko (bialix) said :
#1

Bradley Friedman пишет:
> New question #177452 on ScmProj plugin:
> https://answers.launchpad.net/bzr-scmproj/+question/177452
>
> take the following command as an example:
>
> bzr pcmd -v --dry-run "send -o \"{PROJECT_ROOT}\\changeset_build\\{BRANCH_NAME}\" {BRANCH_URL}"
>
> note the generated commands for both the actual project root and a subproject:
>
> # Component: root
> # Run command: bzr send -o "C:/Users/localadmin/Documents/bzr_branches/fiecom_changesets/\\changeset_build\\
> root branch" bzr+ssh://bazaar.launchpad.net/%2Bbranch/fiecom/
>
> # Component: fiecac
> # Entering directory `fiecac'
> # Run command: bzr send -o "C:/Users/localadmin/Documents/bzr_branches/fiecom_changesets/\\changeset_build\\
> root branch" bzr+ssh://bazaar.launchpad.net/%2Bbranch/fiecac/
>
> I'd expect either, for the "{PROJECT_ROOT}" to change to match the new root of the subproject, or for the {BRANCH_NAME} to change for the subproject based on its name. Instead, they go to the same location, and they use the same default name of "root branch".
>
> Is this a bug? Or am I perhaps doing something incorrect here?

I'm not sure is it bug or not. At least I can't see anything wrong here.

PROJECT_ROOT refers to the root of the top-most project, not to the
subproject root. And BRANCH_NAME perhaps is not so useful here. It was
useful with projects version 1, but that was at the beginning of the
scmproj project. I think today only RELPATH and BRANCH_URL is much
more useful.

I'd recommend you to try using RELPATH instead of BRANCH_NAME.

--
All the dude wanted was his rug back

Revision history for this message
Bradley Friedman (brad-fie) said :
#2

For what I'm doing, relpaths don't make much sense.

I've authored a patch and proposed it for merging. It was trivial to set the name for a subproject once I took a look at the code.

If PROJECT_ROOT stays constant (which I do think makes sense) then the name resolving to "root branch" for a subproject does not makes sense. It's not the root. And since it has a name in the cfg, it's trivial to use that name.

Can you help with this problem?

Provide an answer of your own, or ask Bradley Friedman for more information if necessary.

To post a message you must log in.