~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branches.py

  • Committer: Michael Ellerman
  • Date: 2005-10-19 11:34:39 UTC
  • mto: (0.3.1 shelf-dev) (325.1.2 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 246.
  • Revision ID: michael@ellerman.id.au-20051019113439-193bca379eec5798
Move all shelf functions into a class. Only logic change is we save the
bzr root dir rather than recomputing it again and again.

Show diffs side-by-side

added added

removed removed

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