branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.
However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
Corrupt an hg repo with two pulls.
create one repo with a long history
$ hg init source1
$ cd source1
$ touch foo
$ hg add foo
$ for i in 1 2 3 4 5 6 7 8 9 10; do
> echo $i >> foo
> hg ci -m $i
> done
$ cd ..
create a third repo to pull both other repos into it
$ hg init version2
$ hg -R version2 pull source1 &
$ sleep 1
pulling from source1
requesting all changes
adding changesets
adding manifests
adding file changes
added 10 changesets with 10 changes to 1 files
(run 'hg update' to get a working copy)
$ hg clone --pull -U version2 corrupted
requesting all changes
adding changesets
adding manifests
adding file changes
added 10 changesets with 10 changes to 1 files
$ wait
$ hg -R corrupted verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 10 changesets, 10 total revisions
$ hg -R version2 verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 10 changesets, 10 total revisions