2109 |
2110 |
2110 def write(self, path, data, flags='', **kwargs): |
2111 def write(self, path, data, flags='', **kwargs): |
2111 if data is None: |
2112 if data is None: |
2112 raise error.ProgrammingError("data must be non-None") |
2113 raise error.ProgrammingError("data must be non-None") |
2113 self._auditconflicts(path) |
2114 self._auditconflicts(path) |
2114 self._markdirty(path, exists=True, data=data, date=util.makedate(), |
2115 self._markdirty(path, exists=True, data=data, date=dateutil.makedate(), |
2115 flags=flags) |
2116 flags=flags) |
2116 |
2117 |
2117 def setflags(self, path, l, x): |
2118 def setflags(self, path, l, x): |
2118 self._markdirty(path, exists=True, date=util.makedate(), |
2119 self._markdirty(path, exists=True, date=dateutil.makedate(), |
2119 flags=(l and 'l' or '') + (x and 'x' or '')) |
2120 flags=(l and 'l' or '') + (x and 'x' or '')) |
2120 |
2121 |
2121 def remove(self, path): |
2122 def remove(self, path): |
2122 self._markdirty(path, exists=False) |
2123 self._markdirty(path, exists=False) |
2123 |
2124 |
2402 removed and the new file added with copy information (see |
2403 removed and the new file added with copy information (see |
2403 memfilectx). |
2404 memfilectx). |
2404 |
2405 |
2405 user receives the committer name and defaults to current |
2406 user receives the committer name and defaults to current |
2406 repository username, date is the commit date in any format |
2407 repository username, date is the commit date in any format |
2407 supported by util.parsedate() and defaults to current date, extra |
2408 supported by dateutil.parsedate() and defaults to current date, extra |
2408 is a dictionary of metadata or is left empty. |
2409 is a dictionary of metadata or is left empty. |
2409 """ |
2410 """ |
2410 |
2411 |
2411 # Mercurial <= 3.1 expects the filectxfn to raise IOError for missing files. |
2412 # Mercurial <= 3.1 expects the filectxfn to raise IOError for missing files. |
2412 # Extensions that need to retain compatibility across Mercurial 3.1 can use |
2413 # Extensions that need to retain compatibility across Mercurial 3.1 can use |
2617 'parents' is a sequence of two parent revisions identifiers (pass None for |
2618 'parents' is a sequence of two parent revisions identifiers (pass None for |
2618 every missing parent), 'text' is the commit. |
2619 every missing parent), 'text' is the commit. |
2619 |
2620 |
2620 user receives the committer name and defaults to current repository |
2621 user receives the committer name and defaults to current repository |
2621 username, date is the commit date in any format supported by |
2622 username, date is the commit date in any format supported by |
2622 util.parsedate() and defaults to current date, extra is a dictionary of |
2623 dateutil.parsedate() and defaults to current date, extra is a dictionary of |
2623 metadata or is left empty. |
2624 metadata or is left empty. |
2624 """ |
2625 """ |
2625 def __new__(cls, repo, originalctx, *args, **kwargs): |
2626 def __new__(cls, repo, originalctx, *args, **kwargs): |
2626 return super(metadataonlyctx, cls).__new__(cls, repo) |
2627 return super(metadataonlyctx, cls).__new__(cls, repo) |
2627 |
2628 |