Muhtemelen ConvertExtension gibi bir şeye ihtiyacınız vardır. --splicemap
seçeneğini kontrol edin.
ilk revizyon olarak eklenen bir .hgignore dosyasıyla yeni tarih oluşturmak için:
- olan tek revizyon işlemek .hgignore olan yeni bir depo oluşturun.
- İki 40-char hashes içeren bir splicemap dosyası oluşturun: geçerli veritabanınızın rev 0'ı ve yeni veritabanınızın 0'ı.
- Bu yeni veritabanına geçerli veritabanında her revizyon ekleyen
hg convert <current_db_dir> <new_db_dir> --splicemap splice_filename
çalıştırın. Splicemap, ebeveynlerin düzenlenmesini belirtir. Bu nedenle, güncel veritabanının revizyonu 0, üst öğesinin yeni veritabanının revizyon 0'ı olarak ayarlanmasını sağlar.
Aşağıda, 3 revizyonlu bir veritabanı ve bir .hgignore dosyası içeren 1 sürümlü bir veritabanı oluşturan bir Windows toplu iş dosyası vardır, bunları birleştirir. Sonuç, aradığınız şey olmalıdır. Büyük bir orijinal veritabanınız varsa, kaynak veritabanının tüm geçmişi hedef veritabanına yeniden yazıldığından, bir süre alabilir.
@echo off
@REM Create a 3-revision database
hg init current
cd current
echo >file1
hg add
hg ci -m file1
echo >file2
hg add
hg ci -m file2
echo >file3
hg add
hg ci -m file3
@REM Add the first revision to the splice map
hg log -r 0 --template "{node} " > ..\map
@REM Display the result
hg log
cd ..
@REM Create a 1-revision database
hg init ignore
cd ignore
echo glob:*.txt>.hgignore
hg add
hg ci -m ignore
@REM Specify this node as the parent of the other
@REM database's first revision in the splice map
hg log -r 0 --template "{node}\n" >> ..\map
hg log
cd ..
@REM Here's the resulting splice map
type map
@REM Make a copy to store the result
hg clone ignore result
@REM Add revisions from "current" to "result" honoring
@REM the splice map
hg convert current result --splicemap map
@REM Display the result
cd result
hg log
hg geçmişinin değişmez olması için tasarlanmıştır. Bununla birlikte, en iyi bahsiniz ya (1) her şeyi yeniden ifade etmektir, ancak dosyanızı içe aktarmadan önce ekleyebilir veya (2) bazı hg sıraları dans etmeyi tercih edebilirsiniz. –