Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.227
diff -u -r1.227 file.inc
--- includes/file.inc	1 Sep 2010 20:08:17 -0000	1.227
+++ includes/file.inc	7 Sep 2010 22:12:14 -0000
@@ -1143,6 +1143,7 @@
 
   // Let other modules clean up any references to the deleted file.
   module_invoke_all('file_delete', $file);
+  module_invoke_all('entity_delete', $file, 'file');
 
   // Make sure the file is deleted before removing its row from the
   // database, so UIs can still find the file in the database.
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.190
diff -u -r1.190 system.api.php
--- modules/system/system.api.php	5 Sep 2010 02:21:38 -0000	1.190
+++ modules/system/system.api.php	7 Sep 2010 22:12:26 -0000
@@ -288,6 +288,17 @@
 }
 
 /**
+ * Act on entities when deleted.
+ *
+ * @param $entity
+ *   The entity object.
+ * @param $type
+ *   The type of entity being deleted (i.e. node, user, comment).
+ */
+function hook_entity_delete($entity, $type) {
+}
+
+/**
  * Alter or execute an EntityFieldQuery.
  *
  * @param EntityFieldQuery $query
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1296
diff -u -r1.1296 node.module
--- modules/node/node.module	5 Sep 2010 02:21:38 -0000	1.1296
+++ modules/node/node.module	7 Sep 2010 22:12:21 -0000
@@ -1151,6 +1151,7 @@
       // Call the node-specific callback (if any):
       node_invoke($node, 'delete');
       module_invoke_all('node_delete', $node);
+      module_invoke_all('entity_delete', $node, 'node');
       field_attach_delete('node', $node);
 
       // Remove this node from the search index if needed.
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1198
diff -u -r1.1198 user.module
--- modules/user/user.module	5 Sep 2010 02:21:38 -0000	1.1198
+++ modules/user/user.module	7 Sep 2010 22:12:33 -0000
@@ -2346,6 +2346,7 @@
 
     foreach ($accounts as $uid => $account) {
       module_invoke_all('user_delete', $account);
+      module_invoke_all('entity_delete', $account, 'user');
       field_attach_delete('user', $account);
     }
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.604
diff -u -r1.604 taxonomy.module
--- modules/taxonomy/taxonomy.module	4 Sep 2010 15:40:52 -0000	1.604
+++ modules/taxonomy/taxonomy.module	7 Sep 2010 22:12:27 -0000
@@ -424,7 +424,8 @@
     ->execute();
 
   field_attach_delete_bundle('taxonomy_term', $vocabulary['machine_name']);
-  module_invoke_all('taxonomy', 'delete', 'vocabulary', $vocabulary);
+  module_invoke_all('taxonomy_vocabulary_delete', $vocabulary);
+  module_invoke_all('entity_delete', $vocabulary, 'taxonomy_vocabulary');
 
   cache_clear_all();
   entity_get_controller('taxonomy_vocabulary')->resetCache();
@@ -580,6 +581,7 @@
 
         field_attach_delete('taxonomy_term', $term);
         module_invoke_all('taxonomy_term_delete', $term);
+        module_invoke_all('entity_delete', $term, 'taxonomy_term');
         taxonomy_terms_static_reset();
       }
     }
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.894
diff -u -r1.894 comment.module
--- modules/comment/comment.module	5 Sep 2010 02:21:38 -0000	1.894
+++ modules/comment/comment.module	7 Sep 2010 22:12:17 -0000
@@ -1577,6 +1577,7 @@
     foreach ($comments as $comment) {
       field_attach_delete('comment', $comment);
       module_invoke_all('comment_delete', $comment);
+      module_invoke_all('entity_delete', $comment, 'comment');
 
       // Delete the comment's replies.
       $child_cids = db_query('SELECT cid FROM {comment} WHERE pid = :cid', array(':cid' => $comment->cid))->fetchCol();
