~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branches.py

  • Committer: Aaron Bentley
  • Date: 2006-12-13 06:53:20 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20061213065320-33dwsj7qqbdkuuqo
Tolerate commit ids with no email

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from bzrlib.transport import get_transport
2
 
from bzrtools import list_branches
3
 
 
 
2
from bzrtools import iter_branches, apache_ls
4
3
 
5
4
def branches(location=None):
6
5
    if location is None:
7
6
        location = '.'
8
7
    t = get_transport(location)
9
 
    for branch in list_branches(t):
 
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):
10
16
        print branch.base[len(t.base):].rstrip('/')