Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Unified Diff: runtime/bin/file_patch.dart

Issue 48513003: If a move has matching target/destination, signal the event as create or delete. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix list size Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/file_system_watcher_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_patch.dart
diff --git a/runtime/bin/file_patch.dart b/runtime/bin/file_patch.dart
index 96a5d16692075832272b52890a6c07777eace102..196fb9e6c459ddf0c46dca2715681a91f0f32090 100644
--- a/runtime/bin/file_patch.dart
+++ b/runtime/bin/file_patch.dart
@@ -93,6 +93,13 @@ class _FileSystemWatcherImpl
if ((event.type & _events) == 0) return;
events.add(event);
}
+ void rewriteMove(event) {
+ if (event[3]) {
+ add(new FileSystemCreateEvent._(getPath(event)));
+ } else {
+ add(new FileSystemDeleteEvent._(getPath(event)));
+ }
+ }
while (socket.available() > 0) {
for (var event in _readEvents()) {
if (event == null) continue;
@@ -117,7 +124,7 @@ class _FileSystemWatcherImpl
pair[link] = event;
}
} else {
- add(new FileSystemMoveEvent._(path, null));
+ rewriteMove(event);
}
}
if ((event[0] & FileSystemEvent.DELETE) != 0) {
@@ -130,7 +137,7 @@ class _FileSystemWatcherImpl
}
}
for (var event in pair.values) {
- events.add(new FileSystemMoveEvent._(getPath(event), null));
+ rewriteMove(event);
}
} else if (event == RawSocketEvent.CLOSED) {
} else if (event == RawSocketEvent.READ_CLOSED) {
« no previous file with comments | « no previous file | runtime/bin/file_system_watcher_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698