Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • hg-git-test-migration hg-git-test-migration
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 79
    • Issues 79
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • heptapod
  • Testing Projects
  • hg-git-test-migrationhg-git-test-migration
  • Issues
  • #128

Closed
Open
Created Oct 21, 2014 by Georges Racinet@gracinet🦑Owner

Crash when pushing a repository including subrepos and [subpaths] section in .hgsub file to GitHub

Created originally on Bitbucket by sdottaka (Takashi Sawanaka)

I'm trying to mirror my Bitbucket repositories to GitHub. I got following error when pushing a repository including subrepos to GitHub:

Operation

hg clone https://bitbucket.org/sdottaka/winimergebuild
cd winimergebuild
hg push git+ssh://git@github.com:sdottaka/winimergebuild.git

pushing to git+ssh://git@github.com:sdottaka/winimergebuild.git
no changes made to subrepo freeimage since last push to git+ssh://git@github.com:sdottaka/freeimage.git
no changes made to subrepo winimerge since last push to git+ssh://git@github.com:sdottaka/winimerge.git
** Unknown exception encountered with possibly-broken third-party extension hg-git
** which supports versions 2.8.1 of Mercurial.
** Please disable hg-git and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/durin42/hg-git/issues
** Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 3.0+3)
** Extensions loaded: eol, strip, mq, hg-git
Traceback (most recent call last):
  File "hg", line 42, in <module>
  File "mercurial\dispatch.pyo", line 28, in run
  File "mercurial\dispatch.pyo", line 69, in dispatch
  File "mercurial\dispatch.pyo", line 138, in _runcatch
  File "mercurial\dispatch.pyo", line 810, in _dispatch
  File "mercurial\dispatch.pyo", line 590, in runcommand
  File "mercurial\dispatch.pyo", line 901, in _runcommand
  File "mercurial\dispatch.pyo", line 872, in checkargs
  File "mercurial\dispatch.pyo", line 807, in <lambda>
  File "mercurial\util.pyo", line 518, in check
  File "mercurial\extensions.pyo", line 151, in wrap
  File "mercurial\util.pyo", line 518, in check
  File "hgext\mq.pyo", line 3387, in mqcommand
  File "mercurial\util.pyo", line 518, in check
  File "mercurial\commands.pyo", line 4716, in push
  File "hgext\hg-git\hgrepo.pyo", line 21, in push
  File "hgext\hg-git\git_handler.pyo", line 284, in push
  File "hgext\hg-git\git_handler.pyo", line 250, in export_commits
  File "hgext\hg-git\git_handler.pyo", line 393, in export_git_objects
  File "hgext\hg-git\git_handler.pyo", line 458, in export_hg_commit
  File "hgext\hg-git\hg2git.pyo", line 152, in update_changeset
  File "hgext\hg-git\hg2git.pyo", line 315, in _handle_subrepos
  File "hgext\hg-git\hg2git.pyo", line 16, in parse_subrepos
  File "hgext\hg-git\util.pyo", line 13, in parse_hgsub
ValueError: need more than 1 value to unpack

.hgsub has [subpaths] section like following:

.hgsub

winimerge = winimerge
freeimage = freeimage

[subpaths]
(https://(?:[^@]+@)?bitbucket\.org/[^/]+)(/[^/]+)/(.*) = \1/\3
^git\+ssh://git@github\.com:([^/]*)/([^/]*)/([^/]*)$ = git+ssh://git@github.com:\1/\3.git

I could avoid the error by applying the patch below. But .gitmodules file in GitHub side repository was not created.

--- c:/Users/sawan_000/AppData/Local/Temp/thg.8gm3zw/hg-git.1.795/hggit/util.py	Tue Oct 21 21:01:14 2014
+++ C:/hg-git/hggit/util.py	Tue Oct 21 18:04:38 2014
@@ -13,3 +13,3 @@
         ls = l.strip();
-        if not ls or ls[0] == '#': continue
+        if not ls or ls[0] == '#' or ls[0] == '[' : continue
         name, value = l.split('=', 1)
Edited May 12, 2021 by Dan Villiom Podlaski Christiansen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking