remote-bzr: make bzr branches configurable per-repo

Different repositories have different branches, some are are even branches themselves. Reported-by: Peter Niederlag <netservice@niekom.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Aug 28, 2013 at 14:23 UTC a11b0ac9e17459c83d89844761ca0c132b4d324c
1 file changed +10 -3
contrib/remote-helpers/git-remote-bzr
+10 -3
@@ -13,8 +13,11 @@
13 # or
14 # % git clone bzr::lp:myrepo
15 #
16 -# If you want to specify which branches you want track (per repo):
17 -# git config remote-bzr.branches 'trunk, devel, test'
16 +# If you want to specify which branches you want to track (per repo):
17 +# % git config remote.origin.bzr-branches 'trunk, devel, test'
18 +#
19 +# Where 'origin' is the name of the repository you want to specify the
20 +# branches.
21 #
22
23 import sys
@@ -852,9 +855,13 @@ def get_repo(url, alias):
855 except bzrlib.errors.NoRepositoryPresent:
856 pass
857
855 - wanted = get_config('remote-bzr.branches').rstrip().split(', ')
858 + wanted = get_config('remote.%s.bzr-branches' % alias).rstrip().split(', ')
859 # stupid python
860 wanted = [e for e in wanted if e]
861 + if not wanted:
862 + wanted = get_config('remote-bzr.branches').rstrip().split(', ')
863 + # stupid python
864 + wanted = [e for e in wanted if e]
865
866 if not wanted:
867 try: