diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1622,6 +1622,18 @@ class workingfilectx(committablefilectx) """wraps repo.wwrite""" self._repo.wwrite(self._path, data, flags) +class workingcommitctx(workingctx): + """A workingcommitctx object makes access to data related to + the revision being committed convenient. + + This hides changes in the working directory, if they aren't + committed in this context. + """ + def __init__(self, repo, changes, + text="", user=None, date=None, extra=None): + super(workingctx, self).__init__(repo, text, user, date, extra, + changes) + class memctx(committablectx): """Use memctx to perform in-memory commits via localrepo.commitctx(). diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1343,7 +1343,8 @@ class localrepository(object): elif f not in self.dirstate: fail(f, _("file not tracked!")) - cctx = context.workingctx(self, text, user, date, extra, status) + cctx = context.workingcommitctx(self, status, + text, user, date, extra) if (not force and not extra.get("close") and not merge and not cctx.files()