Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45265:bd7515273fd6
commitctx: gather more preparation code within the lock context
This is a small change that exist mostly for clarification. I am about to move a
large amount of code in its own function. having all that code next to each
other will make the next changeset clearer.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Jul 2020 23:58:23 +0200 |
parents | 39f4ec4039a8 |
children | 13814622b3b1 |
comparison
equal
deleted
inserted
replaced
45264:39f4ec4039a8 | 45265:bd7515273fd6 |
---|---|
61 repo = repo.unfiltered() | 61 repo = repo.unfiltered() |
62 | 62 |
63 p1, p2 = ctx.p1(), ctx.p2() | 63 p1, p2 = ctx.p1(), ctx.p2() |
64 user = ctx.user() | 64 user = ctx.user() |
65 | 65 |
66 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) | |
67 | |
68 p1copies, p2copies = None, None | |
69 if writechangesetcopy: | |
70 p1copies = ctx.p1copies() | |
71 p2copies = ctx.p2copies() | |
72 filesadded, filesremoved = None, None | |
73 with repo.lock(), repo.transaction(b"commit") as tr: | 66 with repo.lock(), repo.transaction(b"commit") as tr: |
67 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) | |
68 | |
69 p1copies, p2copies = None, None | |
70 if writechangesetcopy: | |
71 p1copies = ctx.p1copies() | |
72 p2copies = ctx.p2copies() | |
73 filesadded, filesremoved = None, None | |
74 if ctx.manifestnode(): | 74 if ctx.manifestnode(): |
75 # reuse an existing manifest revision | 75 # reuse an existing manifest revision |
76 repo.ui.debug(b'reusing known manifest\n') | 76 repo.ui.debug(b'reusing known manifest\n') |
77 mn = ctx.manifestnode() | 77 mn = ctx.manifestnode() |
78 files = ctx.files() | 78 files = ctx.files() |