Mercurial > hg
comparison mercurial/bundlerepo.py @ 49969:84680c003d44 stable
bundlerepo: enforce the requirements declared by the underlying repository
Previously, `hg log -r 'bundle()' -R bundle.hg` was failing for me when run from
source, complaining about an unknown parent, when the system installed `hg`
didn't. Some debugging showed the index was 0 length. It turned out that I
didn't have the C extensions compiled, which a simple `hg log -r .` was able to
indicate. The problem being that the RequirementError got handled by RepoError,
which uses an empty directory as a fallback to process the bundle.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 30 Jan 2023 18:25:11 -0500 |
parents | 642e31cb55f0 |
children | 1bd33932713d |
comparison
equal
deleted
inserted
replaced
49968:566f7dd563c1 | 49969:84680c003d44 |
---|---|
531 # to this new type and initialize the bundle-specific bits of it. | 531 # to this new type and initialize the bundle-specific bits of it. |
532 | 532 |
533 try: | 533 try: |
534 repo = localrepo.instance(ui, repopath, create=False) | 534 repo = localrepo.instance(ui, repopath, create=False) |
535 tempparent = None | 535 tempparent = None |
536 except error.RequirementError: | |
537 raise # no fallback if the backing repo is unsupported | |
536 except error.RepoError: | 538 except error.RepoError: |
537 tempparent = pycompat.mkdtemp() | 539 tempparent = pycompat.mkdtemp() |
538 try: | 540 try: |
539 repo = localrepo.instance(ui, tempparent, create=True) | 541 repo = localrepo.instance(ui, tempparent, create=True) |
540 except Exception: | 542 except Exception: |