~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branches.py

  • Committer: Aaron Bentley
  • Date: 2006-03-24 19:01:30 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060324190130-2208c693486a8b33
Added apache index scraping to the branches command

Show diffs side-by-side

added added

removed removed

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