Show More
@@ -524,10 +524,6 b' class changelog(revlog.revlog):' | |||||
524 | user, |
|
524 | user, | |
525 | date=None, |
|
525 | date=None, | |
526 | extra=None, |
|
526 | extra=None, | |
527 | p1copies=None, |
|
|||
528 | p2copies=None, |
|
|||
529 | filesadded=None, |
|
|||
530 | filesremoved=None, |
|
|||
531 | ): |
|
527 | ): | |
532 | # Convert to UTF-8 encoded bytestrings as the very first |
|
528 | # Convert to UTF-8 encoded bytestrings as the very first | |
533 | # thing: calling any method on a localstr object will turn it |
|
529 | # thing: calling any method on a localstr object will turn it | |
@@ -559,19 +555,23 b' class changelog(revlog.revlog):' | |||||
559 | raise error.StorageError( |
|
555 | raise error.StorageError( | |
560 | _(b'the name \'%s\' is reserved') % branch |
|
556 | _(b'the name \'%s\' is reserved') % branch | |
561 | ) |
|
557 | ) | |
562 | sortedfiles = sorted(files) |
|
558 | sortedfiles = sorted(files.touched) | |
563 | sidedata = None |
|
559 | sidedata = None | |
564 | if self._copiesstorage == b'changeset-sidedata': |
|
560 | if self._copiesstorage == b'changeset-sidedata': | |
565 | sidedata = {} |
|
561 | sidedata = {} | |
|
562 | p1copies = files.copied_from_p1 | |||
566 | if p1copies: |
|
563 | if p1copies: | |
567 | p1copies = metadata.encodecopies(sortedfiles, p1copies) |
|
564 | p1copies = metadata.encodecopies(sortedfiles, p1copies) | |
568 | sidedata[sidedatamod.SD_P1COPIES] = p1copies |
|
565 | sidedata[sidedatamod.SD_P1COPIES] = p1copies | |
|
566 | p2copies = files.copied_from_p2 | |||
569 | if p2copies: |
|
567 | if p2copies: | |
570 | p2copies = metadata.encodecopies(sortedfiles, p2copies) |
|
568 | p2copies = metadata.encodecopies(sortedfiles, p2copies) | |
571 | sidedata[sidedatamod.SD_P2COPIES] = p2copies |
|
569 | sidedata[sidedatamod.SD_P2COPIES] = p2copies | |
|
570 | filesadded = files.added | |||
572 | if filesadded: |
|
571 | if filesadded: | |
573 | filesadded = metadata.encodefileindices(sortedfiles, filesadded) |
|
572 | filesadded = metadata.encodefileindices(sortedfiles, filesadded) | |
574 | sidedata[sidedatamod.SD_FILESADDED] = filesadded |
|
573 | sidedata[sidedatamod.SD_FILESADDED] = filesadded | |
|
574 | filesremoved = files.removed | |||
575 | if filesremoved: |
|
575 | if filesremoved: | |
576 | filesremoved = metadata.encodefileindices( |
|
576 | filesremoved = metadata.encodefileindices( | |
577 | sortedfiles, filesremoved |
|
577 | sortedfiles, filesremoved |
@@ -84,7 +84,7 b' def commitctx(repo, ctx, error=False, or' | |||||
84 | repo.changelog.delayupdate(tr) |
|
84 | repo.changelog.delayupdate(tr) | |
85 | n = repo.changelog.add( |
|
85 | n = repo.changelog.add( | |
86 | mn, |
|
86 | mn, | |
87 |
files |
|
87 | files, | |
88 | ctx.description(), |
|
88 | ctx.description(), | |
89 | tr, |
|
89 | tr, | |
90 | p1.node(), |
|
90 | p1.node(), | |
@@ -92,10 +92,6 b' def commitctx(repo, ctx, error=False, or' | |||||
92 | user, |
|
92 | user, | |
93 | ctx.date(), |
|
93 | ctx.date(), | |
94 | extra, |
|
94 | extra, | |
95 | files.copied_from_p1, |
|
|||
96 | files.copied_from_p2, |
|
|||
97 | files.added, |
|
|||
98 | files.removed, |
|
|||
99 | ) |
|
95 | ) | |
100 | xp1, xp2 = p1.hex(), p2 and p2.hex() or b'' |
|
96 | xp1, xp2 = p1.hex(), p2 and p2.hex() or b'' | |
101 | repo.hook( |
|
97 | repo.hook( |
@@ -8,9 +8,10 b' versions.' | |||||
8 | > convert = |
|
8 | > convert = | |
9 | > EOF |
|
9 | > EOF | |
10 | $ cat <<'EOF' > changefileslist.py |
|
10 | $ cat <<'EOF' > changefileslist.py | |
11 | > from mercurial import (changelog, extensions) |
|
11 | > from mercurial import (changelog, extensions, metadata) | |
12 | > def wrap(orig, clog, manifest, files, *args, **kwargs): |
|
12 | > def wrap(orig, clog, manifest, files, *args, **kwargs): | |
13 | > return orig(clog, manifest, [b"a"], *args, **kwargs) |
|
13 | > files = metadata.ChangingFiles(touched=[b"a"]) | |
|
14 | > return orig(clog, manifest, files, *args, **kwargs) | |||
14 | > def extsetup(ui): |
|
15 | > def extsetup(ui): | |
15 | > extensions.wrapfunction(changelog.changelog, 'add', wrap) |
|
16 | > extensions.wrapfunction(changelog.changelog, 'add', wrap) | |
16 | > EOF |
|
17 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now