diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -439,6 +439,24 @@ return self._changeset.date def files(self): return self._changeset.files + def modified(self): + modified = set(self.files()) + modified.difference_update(self.added()) + modified.difference_update(self.removed()) + return sorted(modified) + def added(self): + added = [] + for f in self.files(): + if not any(f in p for p in self.parents()): + added.append(f) + return added + def removed(self): + removed = [] + for f in self.files(): + if f not in self: + removed.append(f) + return removed + @propertycache def _copies(self): source = self._repo.ui.config('experimental', 'copies.read-from')