Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 23710:745e3b485632
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 31 Dec 2014 17:55:43 +0900 |
parents | f8df993516d0 |
children | e3a0e7e21f54 |
comparison
equal
deleted
inserted
replaced
23709:33e5431684c0 | 23710:745e3b485632 |
---|---|
1341 else: | 1341 else: |
1342 fail(f, _("no match under directory!")) | 1342 fail(f, _("no match under directory!")) |
1343 elif f not in self.dirstate: | 1343 elif f not in self.dirstate: |
1344 fail(f, _("file not tracked!")) | 1344 fail(f, _("file not tracked!")) |
1345 | 1345 |
1346 cctx = context.workingctx(self, text, user, date, extra, status) | 1346 cctx = context.workingcommitctx(self, status, |
1347 text, user, date, extra) | |
1347 | 1348 |
1348 if (not force and not extra.get("close") and not merge | 1349 if (not force and not extra.get("close") and not merge |
1349 and not cctx.files() | 1350 and not cctx.files() |
1350 and wctx.branch() == wctx.p1().branch()): | 1351 and wctx.branch() == wctx.p1().branch()): |
1351 return None | 1352 return None |