Last active
March 27, 2019 04:59
-
-
Save jmwilson/c63f4b9beec5edbfd0d8e24db9aa5a81 to your computer and use it in GitHub Desktop.
hg-git on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Procedure for patching hg-git into Windows Mercurial | |
Tested on Windows 10, Mercurial 4.9.1, and Python 2.7 on March 26, 2019 | |
1. Install Mercurial and Python 2.7 | |
Assume Mercurial is in C:\Program Files\Mercurial, Python 2.7 is in C:\Python27\python.exe | |
2. Copy mercurial's library.zip to a place in TEMP | |
mkdir ${env:TEMP}\mercurial | |
Copy-Item 'C:\Program Files\Mercurial\lib\library.zip' ${env:TEMP}\mercurial | |
Set-Location ${env:TEMP}\mercurial | |
3. Get hg-git sources | |
hg clone https://bitbucket.org/durin42/hg-git | |
4. Using explorer, open library.zip and copy hg-git\hggit to library.zip | |
5. Replace dulwich: | |
virtualenv -p C:\Python27\python.exe venv | |
. venv\scripts\activate.ps1 | |
pip install dulwich | |
Using explorer, recursively copy all .pyc files from here into respective locations in the dulwich directory in library.zip. | |
6. Replace Mercurial's library.zip as administrator | |
Copy-Item 'C:\Program Files\Mercurial\lib\library.zip' 'C:\Program Files\Mercurial\lib\library.zip.orig' | |
Copy-Item ${env:TEMP}\mercurial\library.zip 'C:\Program Files\Mercurial\lib\library.zip' | |
7. Replace dulwich compiled modules | |
Copy-Item 'C:\Program Files\Mercurial\lib\dulwich._diff_tree.pyd' 'C:\Program Files\Mercurial\lib\dulwich._diff_tree.pyd.orig' | |
Copy-Item 'C:\Program Files\Mercurial\lib\dulwich._objects.pyd' 'C:\Program Files\Mercurial\lib\dulwich._objects.pyd.orig' | |
Copy-Item 'C:\Program Files\Mercurial\lib\dulwich._pack.pyd' 'C:\Program Files\Mercurial\lib\dulwich._pack.pyd.orig' | |
Copy-Item ${env:TEMP}\mercurial\venv\Lib\site-packages\dulwich\_diff_tree.pyd 'C:\Program Files\Mercurial\lib\dulwich._diff_tree.pyd' | |
Copy-Item ${env:TEMP}\mercurial\venv\Lib\site-packages\dulwich\_objects.pyd 'C:\Program Files\Mercurial\lib\dulwich._objects.pyd' | |
Copy-Item ${env:TEMP}\mercurial\venv\Lib\site-packages\dulwich\_pack.pyd 'C:\Program Files\Mercurial\lib\dulwich._pack.pyd' | |
8. Edit section in ${env:USERPROFILE}/mercurial.ini: | |
[extensions] | |
hggit= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment