~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branches.py

  • Committer: Aaron Bentley
  • Date: 2006-06-13 02:31:28 UTC
  • mfrom: (0.1.119 shelf)
  • Revision ID: aaron.bentley@utoronto.ca-20060613023128-20f2ff3a212a6ea2
Pull in latest shelf stuff

Show diffs side-by-side

added added

removed removed

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