~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Alexander Belchenko
  • Date: 2007-11-23 08:31:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3020.
  • Revision ID: bialix@ukr.net-20071123083124-qwnpye1f4149z9b5
tests added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
            os.symlink(target, self._limbo_name(trans_id))
393
393
            unique_add(self._new_contents, trans_id, 'symlink')
394
394
        else:
395
 
            raise UnableCreateSymlink
 
395
            try:
 
396
                path = FinalPaths(self).get_path(trans_id)
 
397
            except KeyError:
 
398
                path = None
 
399
            raise UnableCreateSymlink(path=path)
396
400
 
397
401
    def cancel_creation(self, trans_id):
398
402
        """Cancel the creation of new file contents."""
1241
1245
            self._known_paths[trans_id] = self._determine_path(trans_id)
1242
1246
        return self._known_paths[trans_id]
1243
1247
 
 
1248
 
1244
1249
def topology_sorted_ids(tree):
1245
1250
    """Determine the topological order of the ids in a tree"""
1246
1251
    file_ids = list(tree)
1272
1277
    finally:
1273
1278
        wt.unlock()
1274
1279
 
 
1280
 
1275
1281
def _build_tree(tree, wt):
1276
1282
    """See build_tree."""
1277
1283
    if len(wt.inventory) > 1:  # more than just a root
1442
1448
    else:
1443
1449
        raise errors.BadFileKindError(name, kind)
1444
1450
 
 
1451
 
1445
1452
def create_by_entry(tt, entry, tree, trans_id, lines=None, mode_id=None):
1446
1453
    """Create new file contents according to an inventory entry."""
1447
1454
    if entry.kind == "file":
1453
1460
    elif entry.kind == "directory":
1454
1461
        tt.create_directory(trans_id)
1455
1462
 
 
1463
 
1456
1464
def create_entry_executability(tt, entry, trans_id):
1457
1465
    """Set the executability of a trans_id according to an inventory entry"""
1458
1466
    if entry.kind == "file":