~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset.py

  • Committer: abentley
  • Date: 2005-10-14 04:32:24 UTC
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1460.
  • Revision ID: abentley@lappy-20051014043224-347635f0e1fbc673
Propogated has_or_had_id to Tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
944
944
                except OSError, e:
945
945
                    if e.errno != errno.ENOENT:
946
946
                        raise
947
 
                    if conflict_handler.missing_for_rename(src_path, to_name) \
948
 
                        == "skip":
 
947
                    if conflict_handler.missing_for_rename(src_path) == "skip":
949
948
                        continue
950
949
 
951
950
    return temp_name
967
966
    :type reverse: bool
968
967
    """
969
968
    for entry in target_entries:
970
 
        print entry.contents_change
971
969
        new_tree_path = entry.get_new_path(inventory, changeset, reverse)
972
970
        if new_tree_path is None:
973
971
            continue
1073
1071
 
1074
1072
 
1075
1073
class MissingForRename(Exception):
1076
 
    def __init__(self, filename, to_path):
1077
 
        msg = "Attempt to move missing path %s to %s" % (filename, to_path)
 
1074
    def __init__(self, filename):
 
1075
        msg = "Attempt to move missing path %s" % (filename)
1078
1076
        Exception.__init__(self, msg)
1079
1077
        self.filename = filename
1080
1078
 
1150
1148
    def missing_for_rm(self, filename, change):
1151
1149
        raise MissingForRm(filename)
1152
1150
 
1153
 
    def missing_for_rename(self, filename, to_path):
1154
 
        raise MissingForRename(filename, to_path)
 
1151
    def missing_for_rename(self, filename):
 
1152
        raise MissingForRename(filename)
1155
1153
 
1156
1154
    def missing_for_merge(self, file_id, other_path):
1157
1155
        raise MissingForMerge(other_path)
1224
1222
    r_inventory = {}
1225
1223
    for entry in tree.source_inventory().itervalues():
1226
1224
        inventory[entry.id] = entry.path
1227
 
    new_inventory = apply_changeset(cset, r_inventory, tree.root,
 
1225
    new_inventory = apply_changeset(cset, r_inventory, tree.basedir,
1228
1226
                                    reverse=reverse)
1229
1227
    new_entries, remove_entries = \
1230
1228
        get_inventory_change(inventory, new_inventory, cset, reverse)
1429
1427
            yield self.get_entry(file_id, tree)
1430
1428
 
1431
1429
    def get_entry(self, file_id, tree):
1432
 
        if not tree.has_id(file_id, allow_root=True):
 
1430
        if not tree.has_or_had_id(file_id):
1433
1431
            return None
1434
 
        return tree.inventory[file_id]
 
1432
        return tree.tree.inventory[file_id]
1435
1433
 
1436
1434
    def get_entry_parent(self, entry):
1437
1435
        if entry is None:
1439
1437
        return entry.parent_id
1440
1438
 
1441
1439
    def get_path(self, file_id, tree):
1442
 
        if not tree.has_id(file_id, allow_root=True):
 
1440
        if not tree.has_or_had_id(file_id):
1443
1441
            return None
1444
1442
        path = tree.id2path(file_id)
1445
1443
        if path == '':
1535
1533
 
1536
1534
 
1537
1535
def full_path(entry, tree):
1538
 
    return os.path.join(tree.root, entry.path)
 
1536
    return os.path.join(tree.basedir, entry.path)
1539
1537
 
1540
1538
def new_delete_entry(entry, tree, inventory, delete):
1541
1539
    if entry.path == "":