~jteh/trac-bzr/newDeps

« back to all changes in this revision

Viewing changes to tracbzr/backend.py

  • Committer: Martin von Gagern
  • Date: 2010-04-10 18:03:50 UTC
  • mfrom: (99.2.17 0.3)
  • Revision ID: martin.vgagern@gmx.net-20100410180350-thoyq8buakgsxq6t
merged 0.3.3 tag

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
    """Present a bzr branch as a trac repository."""
241
241
 
242
242
    primary_branches = config.ListOption(
243
 
        config_section, 'primary_branches', ',trunk', keep_empty = True, 
 
243
        config_section, 'primary_branches', 'trunk', keep_empty = True, 
244
244
        doc = """Ordered list of primary branches.
245
245
 
246
246
        These will be listed first in the Branches macro. When viewing
250
250
        empty list element can be used to denote the branch at the
251
251
        root of the repository.
252
252
 
253
 
        Defaults to ',trunk'.""")
 
253
        Defaults to 'trunk'.""")
 
254
 
 
255
    include_sideline_changes = config.BoolOption(
 
256
        config_section, 'include_sideline_changes', True,
 
257
        doc = """Include sideline changes in the list of changes.
 
258
 
 
259
        This option controls whether sideline changes (i.e. changes
 
260
        with dotted revision numbers only) are included in the list of
 
261
        changes as reported by the timeline view. Note that there
 
262
        might be other plugins using that information as well, so
 
263
        there might be other components beside the timeline view that
 
264
        get affected by this setting.
 
265
 
 
266
        Defaults to True.""")
254
267
 
255
268
    def __init__(self, location, component):
256
269
        versioncontrol.Repository.__init__(self, location, None, component.log)
513
526
            else:
514
527
                rhs = []
515
528
            rhss.append(rhs)
516
 
        for (relpath, branch), rhs in zip(branches, rhss):
517
 
            cache = self.get_branch_cache(branch)
518
 
            while rhs:
519
 
                revid = rhs.pop()
520
 
                new_rhs = walk(cache, revid)
521
 
                if new_rhs:
522
 
                    rhs.extend(new_rhs)
 
529
        if self.include_sideline_changes:
 
530
            for (relpath, branch), rhs in zip(branches, rhss):
 
531
                cache = self.get_branch_cache(branch)
 
532
                while rhs:
 
533
                    revid = rhs.pop()
 
534
                    new_rhs = walk(cache, revid)
 
535
                    if new_rhs:
 
536
                        rhs.extend(new_rhs)
523
537
        inrange.sort()
524
538
        return [chgset for time, revid, chgset in inrange]
525
539
 
854
868
                       self.bzr_repo.string_rev(self.branch, NULL_REVISION),
855
869
                       versioncontrol.Changeset.ADD)
856
870
                return
857
 
        yield (self.path, BzrRepository._escape_revid(CURRENT_REVISION), 'add')
 
871
        yield (self.path,
 
872
               BzrRepository._escape_revid(CURRENT_REVISION),
 
873
               versioncontrol.Changeset.ADD)
858
874
        return
859
875
 
860
876
 
886
902
        return None
887
903
 
888
904
    def get_history(self, limit=None):
889
 
        return []
 
905
        yield (self.path, 
 
906
               self.bzr_repo.string_rev(self.branch, NULL_REVISION),
 
907
               versioncontrol.Changeset.ADD)
890
908
 
891
909
 
892
910
class BzrVersionedNode(BzrNode):