~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

Use ROOT_ID when the repository supports old clients (Bug #107168)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1246
1246
        :param revision_id: allows creating a working tree at a different
1247
1247
        revision than the branch is at.
1248
1248
 
1249
 
        These trees get an initial random root id.
 
1249
        These trees get an initial random root id, if their repository supports
 
1250
        rich root data, TREE_ROOT otherwise.
1250
1251
        """
1251
1252
        revision_id = osutils.safe_revision_id(revision_id)
1252
1253
        if not isinstance(a_bzrdir.transport, LocalTransport):
1274
1275
        wt.current_dirstate()._validate()
1275
1276
        try:
1276
1277
            if revision_id in (None, NULL_REVISION):
1277
 
                wt._set_root_id(generate_ids.gen_root_id())
 
1278
                if branch.repository.supports_rich_root():
 
1279
                    wt._set_root_id(generate_ids.gen_root_id())
 
1280
                else:
 
1281
                    wt._set_root_id(ROOT_ID)
1278
1282
                wt.flush()
1279
1283
                wt.current_dirstate()._validate()
1280
1284
            wt.set_last_revision(revision_id)