D6367: context: add modified(), added(), removed() to changectx too

Yuya Nishihara yuya at tcha.org
Sat May 11 22:59:13 EDT 2019


> +    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

Do these definitions agree with the committablectx ones?
I think the committablectx calculates them based on the status from p1.


More information about the Mercurial-devel mailing list