~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-04 11:38:49 UTC
  • mfrom: (6184 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6185.
  • Revision ID: v.ladeuil+lp@free.fr-20111004113849-9os4pc4swnvdklxk
Merge trunk to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
2634
2634
        repo = self.make_repository(relpath, format=format)
2635
2635
        return repo.bzrdir.create_branch(append_revisions_only=False)
2636
2636
 
2637
 
    def resolve_format(self, format):
2638
 
        """Resolve an object to a ControlDir format object.
2639
 
 
2640
 
        The initial format object can either already be
2641
 
        a ControlDirFormat, None (for the default format),
2642
 
        or a string with the name of the control dir format.
2643
 
 
2644
 
        :param format: Object to resolve
2645
 
        :return A ControlDirFormat instance
2646
 
        """
2647
 
        if format is None:
2648
 
            format = 'default'
2649
 
        if isinstance(format, basestring):
2650
 
            format = bzrdir.format_registry.make_bzrdir(format)
2651
 
        return format
2652
 
 
2653
 
    def resolve_format(self, format):
2654
 
        """Resolve an object to a ControlDir format object.
2655
 
 
2656
 
        The initial format object can either already be
2657
 
        a ControlDirFormat, None (for the default format),
2658
 
        or a string with the name of the control dir format.
2659
 
 
2660
 
        :param format: Object to resolve
2661
 
        :return A ControlDirFormat instance
2662
 
        """
2663
 
        if format is None:
2664
 
            format = 'default'
 
2637
    def get_default_format(self):
 
2638
        return 'default'
 
2639
 
 
2640
    def resolve_format(self, format):
 
2641
        """Resolve an object to a ControlDir format object.
 
2642
 
 
2643
        The initial format object can either already be
 
2644
        a ControlDirFormat, None (for the default format),
 
2645
        or a string with the name of the control dir format.
 
2646
 
 
2647
        :param format: Object to resolve
 
2648
        :return A ControlDirFormat instance
 
2649
        """
 
2650
        if format is None:
 
2651
            format = self.get_default_format()
2665
2652
        if isinstance(format, basestring):
2666
2653
            format = bzrdir.format_registry.make_bzrdir(format)
2667
2654
        return format
2959
2946
        # this obviously requires a format that supports branch references
2960
2947
        # so check for that by checking bzrdir.BzrDirFormat.get_default_format()
2961
2948
        # RBC 20060208
 
2949
        format = self.resolve_format(format=format)
2962
2950
        b = self.make_branch(relpath, format=format)
2963
2951
        try:
2964
2952
            return b.bzrdir.create_workingtree()