mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
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:
2
gradle/changelog/sub_repos.yaml
Normal file
2
gradle/changelog/sub_repos.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- type: fixed
|
||||||
|
description: Sub repositories in the source view for mercurial repositories
|
||||||
@@ -29,6 +29,7 @@ Prints date, size and last message of files.
|
|||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from mercurial import scmutil
|
from mercurial import scmutil
|
||||||
|
from builtins import open, bytes
|
||||||
|
|
||||||
cmdtable = {}
|
cmdtable = {}
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ class SubRepository:
|
|||||||
def collect_sub_repositories(revCtx):
|
def collect_sub_repositories(revCtx):
|
||||||
subrepos = {}
|
subrepos = {}
|
||||||
try:
|
try:
|
||||||
hgsub = revCtx.filectx(b'.hgsub').data().split('\n')
|
hgsub = revCtx.filectx(b'.hgsub').data().split(b'\n')
|
||||||
for line in hgsub:
|
for line in hgsub:
|
||||||
parts = line.split(b'=')
|
parts = line.split(b'=')
|
||||||
if len(parts) > 1:
|
if len(parts) > 1:
|
||||||
@@ -188,9 +189,9 @@ def collect_sub_repositories(revCtx):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
hgsubstate = revCtx.filectx(b'.hgsubstate').data().split('\n')
|
hgsubstate = revCtx.filectx(b'.hgsubstate').data().split(b'\n')
|
||||||
for line in hgsubstate:
|
for line in hgsubstate:
|
||||||
parts = line.split(' ')
|
parts = line.split(b' ')
|
||||||
if len(parts) > 1:
|
if len(parts) > 1:
|
||||||
subrev = parts[0].strip()
|
subrev = parts[0].strip()
|
||||||
subrepo = subrepos[parts[1].strip()]
|
subrepo = subrepos[parts[1].strip()]
|
||||||
|
|||||||
Reference in New Issue
Block a user