largefiles: restore normal 'clone -u' and 'clone -U' functionality
Previously, tip would be checked out regardless of the -u or -U parameter. I'm
not sure what the 'required for successful walkchangerevs' comment meant, but it
appears to reference code which has since moved to downloadlfiles() in
7d6a660ca151. Perhaps it was to force caching when the -U parameter is given?
The price of this change is that -U --all-largefiles won't cache anything. That
will be fixed next.
Note that X + Y in the 'X largefiles updated, n removed' and 'Y additional
largefiles cached' lines do not add up to the same values in these tests, but
all of the largefiles have been downloaded. The reason being that several
largefiles have the same content (
eb7338044 is pointed to by sub/large2, large3
and sub/large4). In the 'clone -u 1' operation, this largefile is cached to
populate the working directory, even without --all-largefiles. That means the
file isn't downloaded again and cached in the rev where large3 and sub/large4
both point to this file. Downloading that one file in that one rev seems to be
counted twice with 'clone -u 0'. (Maybe it is also being downloaded twice?)
$ echo "[extensions]" >> $HGRCPATH
$ echo "convert = " >> $HGRCPATH
$ echo "[convert]" >> $HGRCPATH
$ echo "hg.tagsbranch=0" >> $HGRCPATH
$ hg init source
$ cd source
$ echo a > a
$ hg ci -qAm adda
Add a merge with one parent in the same branch
$ echo a >> a
$ hg ci -qAm changea
$ hg up -qC 0
$ hg branch branch0
marked working directory as branch branch0
(branches are permanent and global, did you want a bookmark?)
$ echo b > b
$ hg ci -qAm addb
$ hg up -qC
$ hg merge default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -qm mergeab
$ hg tag -ql mergeab
$ cd ..
Miss perl... sometimes
$ cat > filter.py <<EOF
> import sys, re
>
> r = re.compile(r'^(?:\d+|pulling from)')
> sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
> EOF
convert
$ hg convert -v --config convert.hg.clonebranches=1 source dest |
> python filter.py
3 adda
2 changea
1 addb
pulling from default into branch0
1 changesets found
0 mergeab
pulling from default into branch0
1 changesets found
Add a merge with both parents and child in different branches
$ cd source
$ hg branch branch1
marked working directory as branch branch1
(branches are permanent and global, did you want a bookmark?)
$ echo a > file1
$ hg ci -qAm c1
$ hg up -qC mergeab
$ hg branch branch2
marked working directory as branch branch2
(branches are permanent and global, did you want a bookmark?)
$ echo a > file2
$ hg ci -qAm c2
$ hg merge branch1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg branch branch3
marked working directory as branch branch3
(branches are permanent and global, did you want a bookmark?)
$ hg ci -qAm c3
$ cd ..
incremental conversion
$ hg convert -v --config convert.hg.clonebranches=1 source dest |
> python filter.py
2 c1
pulling from branch0 into branch1
4 changesets found
1 c2
pulling from branch0 into branch2
4 changesets found
0 c3
pulling from branch2 into branch3
5 changesets found
pulling from branch1 into branch3
1 changesets found