mercurial/subrepoutil.py
changeset 51743 586759be47dc
parent 51508 08913487ae80
child 51859 f4733654f144
--- a/mercurial/subrepoutil.py	Thu Jan 11 21:58:55 2024 +0100
+++ b/mercurial/subrepoutil.py	Thu Jan 11 21:58:55 2024 +0100
@@ -131,7 +131,7 @@
             # extra escapes are needed because re.sub string decodes.
             repl = re.sub(br'\\\\([0-9]+)', br'\\\1', repl)
             try:
-                src = re.sub(pattern, repl, src, 1)
+                src = re.sub(pattern, repl, src, count=1)
             except re.error as e:
                 raise error.Abort(
                     _(b"bad subrepository pattern in %s: %s")