~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branches.py

  • Committer: Aaron Bentley
  • Date: 2011-06-27 23:07:10 UTC
  • Revision ID: aaron@aaronbentley.com-20110627230710-orth0tzf1kwknfen
Better handling of compound tar names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from bzrlib import errors
 
2
from bzrlib.bzrdir import BzrDir
1
3
from bzrlib.transport import get_transport
2
 
from bzrtools import iter_branches, apache_ls
 
4
from bzrtools import list_branches
 
5
 
3
6
 
4
7
def branches(location=None):
5
8
    if location is None:
6
9
        location = '.'
7
10
    t = get_transport(location)
8
 
    if location.startswith('http://'):
9
 
        lister = apache_ls
10
 
    elif not t.listable():
11
 
        print "Can't list this type of location."
12
 
        return 3
13
 
    else:
14
 
        lister = None
15
 
    for branch in iter_branches(t, lister):
 
11
    for branch in list_branches(t):
16
12
        print branch.base[len(t.base):].rstrip('/')