/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

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        format = bzrdir.BzrDirMetaFormat1()
108
108
        format.repository_format = repository.RepositoryFormatKnit1()
109
109
        return format
 
110
    if typestring == "experimental-knit2":
 
111
        format = bzrdir.BzrDirMetaFormat1()
 
112
        format.repository_format = repository.RepositoryFormatKnit2()
 
113
        return format
110
114
    msg = "Unknown bzr format %s. Current formats are: default, knit,\n" \
111
115
          "metaweave and weave" % typestring
112
116
    raise BzrCommandError(msg)
760
764
        # if the source and to_location are the same, 
761
765
        # and there is no working tree,
762
766
        # then reconstitute a branch
763
 
        if (osutils.abspath(to_location) == 
 
767
        if (osutils.abspath(to_location) ==
764
768
            osutils.abspath(branch_location)):
765
769
            try:
766
770
                source.bzrdir.open_workingtree()
1346
1350
        else:
1347
1351
            # local dir only
1348
1352
            # FIXME ? log the current subdir only RBC 20060203 
1349
 
            dir, relpath = bzrdir.BzrDir.open_containing('.')
 
1353
            if revision is not None \
 
1354
                    and len(revision) > 0 and revision[0].get_branch():
 
1355
                location = revision[0].get_branch()
 
1356
            else:
 
1357
                location = '.'
 
1358
            dir, relpath = bzrdir.BzrDir.open_containing(location)
1350
1359
            b = dir.open_branch()
1351
1360
 
1352
1361
        if revision is None:
1355
1364
        elif len(revision) == 1:
1356
1365
            rev1 = rev2 = revision[0].in_history(b).revno
1357
1366
        elif len(revision) == 2:
 
1367
            if revision[1].get_branch() != revision[0].get_branch():
 
1368
                # b is taken from revision[0].get_branch(), and
 
1369
                # show_log will use its revision_history. Having
 
1370
                # different branches will lead to weird behaviors.
 
1371
                raise BzrCommandError(
 
1372
                    "Log doesn't accept two revisions in different branches.")
1358
1373
            if revision[0].spec is None:
1359
1374
                # missing begin-range means first revision
1360
1375
                rev1 = 1
1648
1663
 
1649
1664
        if tree is None:
1650
1665
            b, relpath = Branch.open_containing(filename)
 
1666
        if revision is not None and revision[0].get_branch() is not None:
 
1667
            b = Branch.open(revision[0].get_branch())
1651
1668
        if revision is None:
1652
1669
            revision_id = b.last_revision()
1653
1670
        else:
2133
2150
                else:
2134
2151
                    return 1
2135
2152
 
2136
 
        branch = self._get_remembered_parent(tree, branch, 'Merging from')
 
2153
        if revision is None \
 
2154
                or len(revision) < 1 or revision[0].needs_branch():
 
2155
            branch = self._get_remembered_parent(tree, branch, 'Merging from')
2137
2156
 
2138
2157
        if revision is None or len(revision) < 1:
2139
2158
            if uncommitted:
2147
2166
            if uncommitted:
2148
2167
                raise BzrCommandError('Cannot use --uncommitted and --revision'
2149
2168
                                      ' at the same time.')
 
2169
            branch = revision[0].get_branch() or branch
2150
2170
            if len(revision) == 1:
2151
2171
                base = [None, None]
2152
2172
                other_branch, path = Branch.open_containing(branch)
2156
2176
                assert len(revision) == 2
2157
2177
                if None in revision:
2158
2178
                    raise BzrCommandError(
2159
 
                        "Merge doesn't permit that revision specifier.")
2160
 
                other_branch, path = Branch.open_containing(branch)
 
2179
                        "Merge doesn't permit empty revision specifier.")
 
2180
                base_branch, path = Branch.open_containing(branch)
 
2181
                branch1 = revision[1].get_branch() or branch
 
2182
                other_branch, path1 = Branch.open_containing(branch1)
 
2183
                if revision[0].get_branch() is not None:
 
2184
                    # then path was obtained from it, and is None.
 
2185
                    path = path1
2161
2186
 
2162
 
                base = [branch, revision[0].in_history(other_branch).revno]
2163
 
                other = [branch, revision[1].in_history(other_branch).revno]
 
2187
                base = [branch, revision[0].in_history(base_branch).revno]
 
2188
                other = [branch1, revision[1].in_history(other_branch).revno]
2164
2189
 
2165
2190
        if tree.branch.get_parent() is None or remember:
2166
2191
            tree.branch.set_parent(other_branch.base)