/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2006-08-16 04:04:30 UTC
  • mfrom: (1922 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1934.
  • Revision ID: aaron.bentley@utoronto.ca-20060816040430-3d869d673bdde644
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
762
762
        old_format = bzrdir.BzrDirFormat.get_default_format()
763
763
        bzrdir.BzrDirFormat.set_default_format(bzrdir.BzrDirMetaFormat1())
764
764
        try:
765
 
            if lightweight:
766
 
                checkout = bzrdir.BzrDirMetaFormat1().initialize(to_location)
767
 
                branch.BranchReferenceFormat().initialize(checkout, source)
768
 
            else:
769
 
                checkout_branch =  bzrdir.BzrDir.create_branch_convenience(
770
 
                    to_location, force_new_tree=False)
771
 
                checkout = checkout_branch.bzrdir
772
 
                checkout_branch.bind(source)
773
 
                if revision_id is not None:
774
 
                    rh = checkout_branch.revision_history()
775
 
                    checkout_branch.set_revision_history(rh[:rh.index(revision_id) + 1])
776
 
            checkout.create_workingtree(revision_id)
 
765
            source.create_checkout(to_location, revision_id, lightweight)
777
766
        finally:
778
767
            bzrdir.BzrDirFormat.set_default_format(old_format)
779
768
 
2096
2085
    takes_args = ['branch?']
2097
2086
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2098
2087
                     Option('show-base', help="Show base revision text in "
2099
 
                            "conflicts")]
 
2088
                            "conflicts"), 
 
2089
                     Option('uncommitted', help='Apply uncommitted changes'
 
2090
                            ' from a working copy, instead of branch changes')]
2100
2091
 
2101
2092
    def help(self):
2102
2093
        from merge import merge_type_help
2104
2095
        return getdoc(self) + '\n' + merge_type_help() 
2105
2096
 
2106
2097
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2107
 
            show_base=False, reprocess=False, remember=False):
 
2098
            show_base=False, reprocess=False, remember=False, 
 
2099
            uncommitted=False):
2108
2100
        if merge_type is None:
2109
2101
            merge_type = Merge3Merger
2110
2102
 
2126
2118
        branch = self._get_remembered_parent(tree, branch, 'Merging from')
2127
2119
 
2128
2120
        if revision is None or len(revision) < 1:
2129
 
            base = [None, None]
2130
 
            other = [branch, -1]
 
2121
            if uncommitted:
 
2122
                base = [branch, -1]
 
2123
                other = [branch, None]
 
2124
            else:
 
2125
                base = [None, None]
 
2126
                other = [branch, -1]
2131
2127
            other_branch, path = Branch.open_containing(branch)
2132
2128
        else:
 
2129
            if uncommitted:
 
2130
                raise BzrCommandError('Cannot use --uncommitted and --revision'
 
2131
                                      ' at the same time.')
2133
2132
            if len(revision) == 1:
2134
2133
                base = [None, None]
2135
2134
                other_branch, path = Branch.open_containing(branch)