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

Unified Diff: appengine/findit/libs/gitiles/change_log.py

Issue 2657913002: [Predator] Add ``Project`` class and ``ClassifySuspect`` method to project and component classifier (Closed)
Patch Set: Fix nits. Created 3 years, 11 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
Index: appengine/findit/libs/gitiles/change_log.py
diff --git a/appengine/findit/libs/gitiles/change_log.py b/appengine/findit/libs/gitiles/change_log.py
index 10d57741bd244a2073ecce18eea7c2bb8eeffdeb..bf8f266e67a7e7b6fe333f9f92233f7e502acd7e 100644
--- a/appengine/findit/libs/gitiles/change_log.py
+++ b/appengine/findit/libs/gitiles/change_log.py
@@ -50,6 +50,20 @@ class FileChangeInfo(namedtuple('FileChangeInfo',
'new_path': self.new_path
}
+ @property
+ def changed_path(self):
+ """Returns the changed path to check when analyzing component or project.
+
+ Except for delete change type, the changed path means the new path after
+ change, for delete type, it is the old path.
+ """
+ # TODO(crbug.com/685884): use component of new path as default. RENAME might
+ # need to return two (old path new path may have different components)
+ if self.change_type == ChangeType.DELETE:
+ return self.old_path
+
+ return self.new_path
+
class Contributor(namedtuple('Contributor', ['name', 'email', 'time'])):
"""A generalization of the "author" and "committer" in Git's terminology."""
« no previous file with comments | « appengine/findit/handlers/crash/test/crash_config_test.py ('k') | appengine/findit/libs/gitiles/test/change_log_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698