# HG changeset patch # User Sean Farley # Date 2017-05-11 20:59:48 # Node ID bf728e72a21901b0ae9170958ade16893c6938e3 # Parent c0b16b801687be26d14cabe501678e24b2a3c117 context: move dirty() to committablectx This is a pedantic move. It should be an error if dirty() is called on a read-only context. Based on Mads Kiilerix's and my work at the sprint. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -323,9 +323,6 @@ class basectx(object): def hasdir(self, dir): return self._manifest.hasdir(dir) - def dirty(self, missing=False, merge=True, branch=True): - return False - def status(self, other=None, match=None, listignored=False, listclean=False, listunknown=False, listsubrepos=False): """return status of files between two nodes or node and working @@ -1569,6 +1566,9 @@ class committablectx(basectx): # from immediately doing so for subsequent changing files self._repo.dirstate.write(self._repo.currenttransaction()) + def dirty(self, missing=False, merge=True, branch=True): + return False + class workingctx(committablectx): """A workingctx object makes access to data related to the current working directory convenient.