Skip to content
Snippets Groups Projects
Commit 1e4860f3409a authored by Boris Feld's avatar Boris Feld
Browse files

convert: update hg convert source to accept revsets as revs

My usecase is to pass a revset like (limit(all(), X, 0)) to convert hg source
repositories pieces by pieces as it seems that hg convert leaks memory. This
way we can bypass the problem by processing the repositories small pieces at
the time.

It also makes convert more flexible.
parent e8c043375b53
No related tags found
No related merge requests found
......@@ -480,7 +480,8 @@
else:
self.keep = util.always
if revs:
self._heads = [self.repo[r].node() for r in revs]
revsnumbers = scmutil.revrange(self.repo, revs)
self._heads = [self.repo[r].node() for r in revsnumbers]
else:
self._heads = self.repo.heads()
else:
......
......@@ -200,3 +200,56 @@
a
c
d
check that convert accepts revsets and that converting a repository in two times works
$ hg convert orig revset-multiple -r "limit(all(), 4, 0)" 2>&1 | grep -v 'subversion python bindings could not be loaded'
initializing destination revset-multiple repository
scanning source...
sorting...
converting...
3 add foo bar
2 change foo
1 make bar and baz copies of foo
0 merge local copy
updating bookmarks
$ hg convert orig revset-multiple -r "limit(all(), 4, 4)" 2>&1 | grep -v 'subversion python bindings could not be loaded'
scanning source...
sorting...
converting...
3 merge remote copy
2 Added tag that for changeset 88586c4e9f02
1 Removed tag that
0 Added tag this for changeset c56a7f387039
updating bookmarks
$ hg convert orig revset-multiple -r "limit(all(), 4, 8)" 2>&1 | grep -v 'subversion python bindings could not be loaded'
scanning source...
sorting...
converting...
2 mark baz executable
1 change foo again
0 change foo again again
updating bookmarks
$ hg -R "revset-multiple" log -G -T '{rev} {desc}'
o 10 change foo again again
|
| o 9 change foo again
| |
| | o 8 mark baz executable
| | |
| | o 7 Added tag this for changeset c56a7f387039
| | |
| | o 6 Removed tag that
| | |
| | o 5 Added tag that for changeset 88586c4e9f02
| | |
+---o 4 merge remote copy
| |/
+---o 3 merge local copy
| |/
o | 2 make bar and baz copies of foo
| |
| o 1 change foo
|/
o 0 add foo bar
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment