Merge lp:~jelmer/bzr-builddeb/location-alias-upstream into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 651
Proposed branch: lp:~jelmer/bzr-builddeb/location-alias-upstream
Merge into: lp:bzr-builddeb
Diff against target: 36 lines (+18/-1)
1 file modified
__init__.py (+18/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/location-alias-upstream
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+83737@code.launchpad.net

Description of the change

Register a ":upstream" location alias if bzr supports it.

This is an alias for the upstream branch location set in debian/bzr-builddeb.conf.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :
Revision history for this message
James Westby (james-w) wrote :

9 +from bzrlib.directory_service import (
10 + AliasDirectory,

Was that introduced recently enough that this will be a problem
on e.g. jubany for deployment?

Thanks,

James

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On 12/02/2011 12:35 AM, James Westby wrote:
> Review: Approve
>
> 9 +from bzrlib.directory_service import (
> 10 + AliasDirectory,
>
> Was that introduced recently enough that this will be a problem
> on e.g. jubany for deployment?
No, AliasDirectory has been around for quite some time - bzr 1.6.

Cheers,

Jelmer

Revision history for this message
Vincent Ladeuil (vila) wrote :

> Was that introduced recently enough that this will be a problem on e.g. jubany for deployment?

For the record: jubany now runs bzr from source so no more worries about dependencies (well, far less at least).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2011-11-22 14:05:25 +0000
3+++ __init__.py 2011-11-29 08:11:25 +0000
4@@ -27,7 +27,10 @@
5
6 import bzrlib
7 from bzrlib.commands import plugin_cmds
8-from bzrlib.directory_service import directories
9+from bzrlib.directory_service import (
10+ AliasDirectory,
11+ directories,
12+ )
13
14 from info import (
15 bzr_plugin_version as version_info,
16@@ -69,6 +72,20 @@
17 'VcsDirectory',
18 "Directory that uses Debian Vcs-* control fields to look up branches")
19
20+branch_aliases = getattr(AliasDirectory, "branch_aliases", None)
21+if branch_aliases is not None:
22+ def upstream_branch_alias(b):
23+ from bzrlib.plugins.builddeb.util import debuild_config
24+ b.lock_read()
25+ try:
26+ tree = b.basis_tree()
27+ config = debuild_config(tree, False)
28+ return directories.dereference(config.upstream_branch)
29+ finally:
30+ b.unlock()
31+ branch_aliases.register("upstream", upstream_branch_alias,
32+ help="upstream branch (for packaging branches)")
33+
34
35 def debian_changelog_commit_message(commit, start_message):
36 if start_message is not None:

Subscribers

People subscribed via source and target branches