[PATCH 3 of 5] context: add workingcommitctx for exact context to be committed

Sean Farley sean.michael.farley at gmail.com
Tue Dec 30 21:47:01 CST 2014


FUJIWARA Katsunori writes:

> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1419984806 -32400
> #      Wed Dec 31 09:13:26 2014 +0900
> # Node ID 7af4e26aa1c601e99bac37971b8f656b3197f14f
> # Parent  6535600e847a3acfe6bb7aa7775d1d15cceab1af
> context: add workingcommitctx for exact context to be committed
>
> Before this patch, "workingctx" is also used for the context to be
> committed. But "workingctx" works incorrectly in some cases.
>
> For example, even when only some of changed files in the working
> directory are committed, "status()" on "workingctx" object for
> committing recognizes files not to be committed as changed, too.
>
> As the preparation for fixing these issues, this patch chooses adding
> new class "workingcommitctx" for exact context to be committed,
> because switching by the flag (like "self._fixedstatus" or so) in some
> code paths of "workingctx" is less readable and maintenancable.

My idea (unfinished) for this line of work was to make things use memctx
for adding and removing the actual hunks of data to commit. The base for
that would be to add read/write methods to the filecommitctx and then
having localrepo.commit use that.

I don't know how I feel about a new class but it's probably ok because
it could potentially be removed later (if I ever get around to finishing
my patches).


More information about the Mercurial-devel mailing list