Fix sub repositories in mercurial

The sub repositories did not show up in the source view.
This fixes python errors for the computation of sub
repositories in hg.

Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
This commit is contained in:
Rene Pfeuffer
2024-06-19 17:46:42 +02:00
parent d74fd099cc
commit b98cdeb28d
2 changed files with 6 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ Prints date, size and last message of files.
from collections import defaultdict
from mercurial import scmutil
from builtins import open, bytes
cmdtable = {}
@@ -177,7 +178,7 @@ class SubRepository:
def collect_sub_repositories(revCtx):
subrepos = {}
try:
hgsub = revCtx.filectx(b'.hgsub').data().split('\n')
hgsub = revCtx.filectx(b'.hgsub').data().split(b'\n')
for line in hgsub:
parts = line.split(b'=')
if len(parts) > 1:
@@ -188,9 +189,9 @@ def collect_sub_repositories(revCtx):
pass
try:
hgsubstate = revCtx.filectx(b'.hgsubstate').data().split('\n')
hgsubstate = revCtx.filectx(b'.hgsubstate').data().split(b'\n')
for line in hgsubstate:
parts = line.split(' ')
parts = line.split(b' ')
if len(parts) > 1:
subrev = parts[0].strip()
subrepo = subrepos[parts[1].strip()]