Montag, 3. Februar 2020

[hg] removing dead subrepository

On migrating my hg-repositories to git I found one project with subrepositories which were already deleted.

Switching branches resulted in
abort: HTTP Error 404: Not Found


 The internet came up with solutions like:
But I couldn't get it to work easily…

What I did finally:
Clone the branch into a new folder
$ hg clone -U -b BRANCH https://bitbucket.org/USER/PROJECT PROJCET-BRANCH
-U will not make an update, which will result in an nearly empty folder. Basically nothing specific is checked out.

Next is getting all files except the .hgsub file, creating that file as empty, setting options, "going" to the branch, committing the change, and pushing it:
$ hg revert -a -r BRANCH -X .hgsub
$ cat /dev/null > .hgsub
$ hg debugrebuildstate -r BRANCH
$ hg debugsetparents BRANCH
$ hg update BRANCH
$ hg branch BRANCH
$ hg ci -m "no subrepos"
$ hg push

1 Kommentar:

  1. Really your solution is much appreciated! You saved my day.

    AntwortenLöschen

[Review/Critic] UDock X - 13,3" LapDock

The UDock X - 13.3" LapDock is a combination of touch display, keyboard, touch-pad and battery. It can be used as an extension of vari...