~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Alexander Belchenko
  • Date: 2006-11-06 10:10:55 UTC
  • mto: This revision was merged to the branch mainline in revision 637.
  • Revision ID: bialix@ukr.net-20061106101055-1accd47e6a50658f
Use hand-written non-recursive branch detector mechanism, because bzrtools's one is too slow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        # give the list of live branches in repository or current branch tip
98
98
        if not branch:
99
99
            # runs from shared repo root
100
 
            from bzrlib.transport import get_transport
101
 
            from bzrtools import iter_branches
102
 
            t = get_transport('.')
103
 
            for branch in iter_branches(t):
104
 
                last_revid = branch.last_revision()
 
100
            for directory in os.listdir(u'.'):
 
101
                if directory == '.bzr':
 
102
                    continue
 
103
                if not os.path.isdir(os.path.join(directory, '.bzr')):
 
104
                    continue
 
105
                try:
 
106
                    b, path = bzrlib.branch.Branch.open_containing(directory)
 
107
                except errors.NotBranchError:
 
108
                    continue
 
109
                last_revid = b.last_revision()
105
110
                head_mark[last_revid] = 'alive'
 
111
#                self._print_elapsed_time('proceed branch ' + str(b)+':')
106
112
        else:
107
113
            # runs from branch
 
114
            # TODO: implementation
108
115
            raise NotImplementedError('TODO: need to detect is there is shared repo or not')
109
 
        self._print_elapsed_time('get head marks:')
 
116
        self._print_elapsed_time('make head marks:')
110
117
 
111
118
        # show time
112
119
        indent = ' '*2