File: branches.py

package info (click to toggle)
bzrtools 0.11.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 508 kB
  • ctags: 560
  • sloc: python: 4,863; sh: 11; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from bzrlib.transport import get_transport
from bzrtools import iter_branches, apache_ls

def branches(location=None):
    if location is None:
        location = '.'
    t = get_transport(location)
    if location.startswith('http://'):
        lister = apache_ls
    elif not t.listable():
        print "Can't list this type of location."
        return 3
    else:
        lister = None
    for branch in iter_branches(t, lister):
        print branch.base[len(t.base):].rstrip('/')