/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: John Arbash Meinel
  • Date: 2006-08-14 22:53:25 UTC
  • mfrom: (1920 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1923.
  • Revision ID: john@arbash-meinel.com-20060814225325-6626efb06d6d33e9
[merge] bzr.dev 1920

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
 
2129
2118
    takes_args = ['branch?']
2130
2119
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2131
2120
                     Option('show-base', help="Show base revision text in "
2132
 
                            "conflicts")]
 
2121
                            "conflicts"), 
 
2122
                     Option('uncommitted', help='Apply uncommitted changes'
 
2123
                            ' from a working copy, instead of branch changes')]
2133
2124
 
2134
2125
    def help(self):
2135
2126
        from merge import merge_type_help
2137
2128
        return getdoc(self) + '\n' + merge_type_help() 
2138
2129
 
2139
2130
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2140
 
            show_base=False, reprocess=False, remember=False):
 
2131
            show_base=False, reprocess=False, remember=False, 
 
2132
            uncommitted=False):
2141
2133
        if merge_type is None:
2142
2134
            merge_type = Merge3Merger
2143
2135
 
2159
2151
        branch = self._get_remembered_parent(tree, branch, 'Merging from')
2160
2152
 
2161
2153
        if revision is None or len(revision) < 1:
2162
 
            base = [None, None]
2163
 
            other = [branch, -1]
 
2154
            if uncommitted:
 
2155
                base = [branch, -1]
 
2156
                other = [branch, None]
 
2157
            else:
 
2158
                base = [None, None]
 
2159
                other = [branch, -1]
2164
2160
            other_branch, path = Branch.open_containing(branch)
2165
2161
        else:
 
2162
            if uncommitted:
 
2163
                raise BzrCommandError('Cannot use --uncommitted and --revision'
 
2164
                                      ' at the same time.')
2166
2165
            if len(revision) == 1:
2167
2166
                base = [None, None]
2168
2167
                other_branch, path = Branch.open_containing(branch)