[Updated] D12604: censor: fix [hg update] away from a revision with censored files
aalekseyev (Arseniy Alekseyev)
phabricator at mercurial-scm.org
Mon May 9 16:16:05 UTC 2022
Closed by commit rHG77b5a190571c: censor: fix [hg update] away from a revision with censored files (authored by aalekseyev).
This revision was automatically updated to reflect the committed changes.
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D12604?vs=33354&id=33387#toc
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D12604?vs=33354&id=33387
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D12604/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D12604
AFFECTED FILES
mercurial/filelog.py
tests/test-censor2.t
CHANGE DETAILS
diff --git a/tests/test-censor2.t b/tests/test-censor2.t
--- a/tests/test-censor2.t
+++ b/tests/test-censor2.t
@@ -19,5 +19,4 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat target
$ hg update tip
- abort: file censored data/target:b1c12cf98dc8 (known-bad-output !)
- [255]
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff --git a/mercurial/filelog.py b/mercurial/filelog.py
--- a/mercurial/filelog.py
+++ b/mercurial/filelog.py
@@ -202,10 +202,10 @@
# for revisions with renames, we have to go the slow way
node = self.node(rev)
+ if self.iscensored(rev):
+ return 0
if self.renamed(node):
return len(self.read(node))
- if self.iscensored(rev):
- return 0
# XXX if self.read(node).startswith("\1\n"), this returns (size+4)
return self._revlog.size(rev)
To: aalekseyev, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220509/f7f12812/attachment-0002.html>
More information about the Mercurial-patches
mailing list