[Commented On] D11399: narrow: show repo corruption when commiting empty files

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Mon Sep 13 19:39:48 UTC 2021


valentin.gatienbaron added a comment.


  Maybe the server could reject such changes, but I'd rather simply roll clients with the fix.
  
  Separately, it's not exactly the kind of corruption from the test that can propagate, because push would fail in the example of the test.
  But if the filelog exists (or presumably, is created afterwards), then the push can succeed. And then hg status when wdir is at such a revision in a non-narrow clone would always report the empty file as being modified.
  
  I doubt someone else cares, but just in case, one can find problematic revisions with this command:
  
    @command(
        b'zzz',
        [
            (b'r', b'rev', b'', _(b'revision to display'), _(b'REV')),
        ],
        intents={INTENT_READONLY},
    )
    def zzz(ui, repo, **opts):
        """"""
        opts = pycompat.byteskwargs(opts)
        repo = repo.unfiltered()
        revs = scmutil.revrange(repo, [opts.get(b'rev')])
        for r in revs:
            node = repo[r].node()
            mnode = repo[r].manifestnode()
            for (f, fnode) in repo.manifestlog[mnode].readdelta().iteritems():
                if fnode == repo.nullid:
                    ui.write(b'%b %b\n' % (hex(node), f))

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11399/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11399

To: valentin.gatienbaron, durin42, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210913/bf6d684f/attachment-0002.html>


More information about the Mercurial-patches mailing list