Debian Patches

Status for hg-git/1.2.0-3

Patch Description Author Forwarded Bugs Origin Last update
compat-add-support-for-dulwich-0.23.2.patch compat: add support for dulwich 0.23.2

diff --git a/hggit/compat.py b/hggit/compat.py
new file mode 100644
index 00000000..8106212d
Dan Villiom Podlaski Christiansen <danchr@gmail.com> no 2025-07-08
hggit-fix-an-incompatibility-with-dulwich-0.24.0.patch hggit: fix an incompatibility with dulwich >= 0.24.0
On dulwich >= 0.24, ssh commands arrive as undecoded bytes, and not strings.
This would trigger an AssertionError when doing network operations.

Modified form https://foss.heptapod.net/mercurial/hg-git/-/merge_requests/260/
by Abhijith Nayak (@reconzo-abhijith).

diff --git a/hggit/_ssh.py b/hggit/_ssh.py
index d3bdc947..1ae55b2a 100644
Dan Villiom Podlaski Christiansen <danchr@gmail.com> no 2025-11-25
git_handler-fix-a-compatibility-issue-with-dulwich-0.24.0.patch git_handler: fix a compatibility issue with dulwich >= 0.24.0
This fixes errors when a pull operation involves new or deleted files.

The error was:
TypeError: cannot unpack non-iterable NoneType object
in git_handler.py, get_files_changed().

Original proposal by @kebianizao and @muxator at
https://foss.heptapod.net/mercurial/hg-git/-/issues/451

Fixes #451.

diff --git a/hggit/git_handler.py b/hggit/git_handler.py
index 30f0fae3..2d6f6624 100644
reconzo-abhijith <abhijith@reconzo.com> no 2025-11-24
git_handler-fix-a-dulwich-0.24.3-incompatibility-in-test-pus.patch git_handler: fix a dulwich 0.24.3 incompatibility in test-push.t

In Dulwich 0.24.3, the determine_wants() function started accepting an
additional "depth" parameter.

Without this change, test-push.t would break with Dulwich >=0.24.3.

This change should be compatible with both the old and the new Dulwich version.

Compare the following:
- 0.24.2 (without "depth"): https://github.com/jelmer/dulwich/blob/dulwich-0.24.2/dulwich/repo.py#L590
- 0.24.3 (with "depth"): https://github.com/jelmer/dulwich/blob/dulwich-0.24.3/dulwich/repo.py#L601

diff --git a/hggit/git_handler.py b/hggit/git_handler.py
index 2d6f6624..6aee91bc 100644
muxator <a.mux@inwind.it> no 2025-11-26
git_handler-fix-a-dulwich-0.24.3-incompatibility.patch git_handler: fix a dulwich 0.24.3 incompatibility
In Dulwich 0.24.3, get_credentials_from_store() started returning an Iterator of
tuples instead of a single tuple. This change covers all the cases.


Definition of get_credentials_from_store() in dulwich 0.24.2 (without Iterator):
https://github.com/jelmer/dulwich/blob/dulwich-0.24.2/dulwich/client.py#L3685
Definition of get_credentials_from_store() in dulwich 0.24.3 (changed to Iterator):
https://github.com/jelmer/dulwich/blob/dulwich-0.24.3/dulwich/client.py#L4275

diff --git a/hggit/git_handler.py b/hggit/git_handler.py
index 6aee91bc..11ad2203 100644
reconzo-abhijith <abhijith@reconzo.com> no 2025-11-24
compat-use-PEELED_TAG_SUFFIX-instead-of-ANNOTATED_TAG_SUFFIX.patch compat: use PEELED_TAG_SUFFIX instead of ANNOTATED_TAG_SUFFIX
Starting from our oldest supported dulwich (0.22.1), and until 0.24.10,
ANNOTATED_TAG_SUFFIX has been an alias for PEELED_TAG_SUFFIX (see sources later
on).

Dulwich 0.25.0 is going to remove support for the alias and move
PEELED_TAG_SUFFIX in another module. Let's address the aliasing in this first
commit. The next one will add compatibility with both old and recent dulwich
(>= 0.25.0).

No functional changes.

Source:
- https://github.com/jelmer/dulwich/blob/dulwich-0.22.1/dulwich/refs.py#L45
- https://github.com/jelmer/dulwich/blob/dulwich-0.24.10/dulwich/refs.py#L62

diff --git a/hggit/git2hg.py b/hggit/git2hg.py
index 6f19c8af..7b2dcad0 100644
Antonio Muci <a.mux@inwind.it> no 2025-12-19
compat-support-dulwich-0.25.patch compat: support dulwich 0.25
In dulwich 0.24.10 ANNOTATED_TAG_SUFFIX was already an alias for
PEELED_TAG_SUFFIX. We stopped relying on the alias in the previous commit.

Dulwich 0.25.0 removed the alias, and moved PEELED_TAG_SUFFIX from dulwich.refs
to dulwich.protocol.

This commit centralizes in hggit.compat a backward compatiblity fix for
supporting PEELED_TAG_SUFFIX in dulwich <=0.24.10 and >=0.25.10.

The tests that broke on dulwich 0.25.0 and that are now fixed are
test-url-parsing.py and test-doctest.py.

The reason for not importing compat.PEELED_TAG_SUFFIX is explained at
https://foss.heptapod.net/mercurial/hg-git/-/merge_requests/269#note_512928

> Normally, in Mercurial and hg-git, we never import attributes from a module,
> we only ever import modules. This ensures that lazy importing works.

diff --git a/hggit/compat.py b/hggit/compat.py
index 8106212d..8ca4e727 100644
Antonio Muci <a.mux@inwind.it> no 2025-12-19
compat-support-dulwich-1.2.x.patch compat: support dulwich 1.2.x
Dulwich deprecated Commit.extra in 0.21.3, and removed it in 1.0.0. The relevant
file in Dulwich is dulwich/objects.py.

The private member _extra has been present since before our earliest supported
version, and it is still present in Dulwich 1.2.x.

To keep compatibility with all Dulwich versions (albeit in a fragile way), we
will rely on _extra, since the construct is only used in test-extra.t and not in
any other hg-git code.

Apart from this commit, no other changes are needed to support Dulwich 1.2.x
(and 1.0.0 before that).

diff --git a/tests/test-extra.t b/tests/test-extra.t
index 23d4637c..5bc7836c 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-20
compat-hg-7.2-moved-parthandler-from-bundle2-to-bundle2_part.patch compat: hg 7.2 moved parthandler from bundle2 to bundle2_part_handlers

The change happened on 2025-08-07 in mercurial 503d63ff9b1a ("cycle-breaking:
register most bundle2 part handler in their own modules"), and was integrated in
mercurial since 7.2.

diff --git a/hggit/bundle.py b/hggit/bundle.py
index 7d5bdd75..fc8d0392 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-02
compat-hg-7.2-removed-repository.peer-and-introduced-exchang.patch compat: hg 7.2 removed repository.peer and introduced exchanges.peer.Peer

The change happened on 2025-10-16 in 15e04d999f43 ("interface: extract the
non-typing code for the peer"), and was integrated in mercurial since 7.2.


exchanges.peer.Peer is still an abstract class, but we can add trivial
implementations for clonebundles() and get_cached_bundle_inline().

The two concrete classes in hg >=7.2 are:
1. mercurial.localrepo.localpeer
2. mercurial.wireprotov1peer.wirepeer

They will be used later in the series.

Albeit not exact, we give the old "peer" class the new name "Peer", in order to
smooth the change when we will get rid of the compatibility code.


diff --git a/hggit/compat.py b/hggit/compat.py
index a0072f5e..cedfc5ed 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-13
gitrepo-add_branch_revs-was-moved-in-a-different-module-in-h.patch gitrepo: add_branch_revs() was moved in a different module in hg >= 7.2

The change happened in mercurial commit:
33a40f393800 ("cycle-breaking: move `add_branch_revs` from `hg` to `urlutil`")


diff --git a/hggit/compat.py b/hggit/compat.py
index cedfc5ed..8addccc1 100644
Jordi Gutiérrez Hermoso <jordigh@octave.org> no 2026-05-13
gitrepo-default_dest-was-moved-in-a-different-module-in-hg-7.patch gitrepo: default_dest() was moved in a different module in hg >= 7.2

The change happened in mercurial commit:
a3b891ff921e ("cycle-breaking: move `default_dest` from `hg` to a `clone` module")


diff --git a/hggit/compat.py b/hggit/compat.py
index 8addccc1..aa4e6da5 100644
Jordi Gutiérrez Hermoso <jordigh@octave.org> no 2026-05-13
gitrepo-selectively-define-instance-function.patch gitrepo: selectively define `instance` function
Because of how Mercurial now instantiates repos, we can no longer be
unconditionally a gitrepo. Instead, we return a localrepo for local
creation.

This is so that `hg clone some_git_repo` works.

diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py
index c988b117..5b8ec595 100644
Jordi Gutiérrez Hermoso <jordigh@octave.org> no 2026-03-28
compat-fix-test-url-parsing.py.patch compat: fix test-url-parsing.py
Before this commit, test-url-parsing.py was failing with the following error:

```
$ tests/run-tests.py --with-hg=<BASE>/venv3.14-hg721-dulwich025/bin/hg tests/test-url-parsing.py

Traceback (most recent call last):
File "<BASE>/tests/test-url-parsing.py", line 113, in <module>
tc.setUp()
~~~~~~~~^^
File "<BASE>/tests/test-url-parsing.py", line 21, in setUp
commands.init(ui.ui(), self.tmpdir)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^

!
Failed test-url-parsing.py: output changed and returned error code 1
```

The change was introduced in mercurial commit 43a67798b33a ("init: introduce a
new initialization system to explicitly load some module").

TODO:
- we could move the compat code in the test, since it is used only there
- we could use hasattr(mercurial.commands, "_init") instead of inspect

diff --git a/hggit/compat.py b/hggit/compat.py
index aa4e6da5..a625ef16 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-13
bundle-fix-test-bundle.t.-be-backward-compatible-in-a-ugly-w.patch bundle: fix test-bundle.t. be backward compatible in a ugly way

hg 7.2 removed the "ui" argument from _addpartsfromopts() in 63c4874dacb6
("bundle: remove unused argument")

diff --git a/hggit/bundle.py b/hggit/bundle.py
index fc8d0392..b6ba2ebd 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-14
bundle-fixe-test-hg-clone.t-and-test-serve-hg.t-with-hggit-o.patch bundle: fixe test-hg-clone.t and test-serve-hg.t#with-hggit on hg >= 7.2

bundle2.getrepocaps() was deprecated and will be removed in 7.3. The deprecation
happened via util.deprecated(), which apparently breaks hggit wrapping.

This change is backwards compatible (tested with hg 7.1.2 and 7.2.1).

diff --git a/hggit/bundle.py b/hggit/bundle.py
index b6ba2ebd..eceece8c 100644
Antonio Muci <a.mux@inwind.it> no 2026-05-14
compat-wrap-correct-functions-after-hg-7.2-moved-them.patch compat: wrap correct functions after hg 7.2 moved them

diff --git a/hggit/compat.py b/hggit/compat.py
index a3ba9617..abc6ca2f 100644
Manuel Jacob <me@manueljacob.de> no 2026-08-20
dulwich-compat =================================================================== no
dulwich-checksum-mismatch Handle ChecksumMismatch raised by dulwich >= 1.2.7 in gverify --fsck=================================================================== no
dulwich.repo.check_ref_format.patch no

All known versions for source package 'hg-git'

Links