I am importing one Mercurial repo into another, maintaining history. There are several bookmarked heads on the default branch, and I want those bookmarked heads to still be bookmarked in the new, merged repo. As far as I can tell, the two ways to do this is to either,
Extending the previous answer, here's how to push all branches using awk and the output of hg bookmarks in bash:
hg bookmarks | awk '{if (NF == 3) print $2; else print $1;}' | xargs -n 1 hg push -f -B
Unix:
hg push $(hg bookmarks -T "-B {bookmark} ")
Windows:
for /f "delims=" %A in ('hg bookmarks -T "-B {bookmark} "') do @hg push %A
PowerShell:
hg bookmarks -T "{bookmark}\n" | %{ Write-Host === Bookmark $_ === ; hg push -B $_ }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With