1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00
phorge-phorge/scripts
epriestley e0b86cc81b Add a Mercurial commit discovery daemon
Summary:
Repository import has three major steps:

  - Commit discovery (serial)
  - Message parsing (parallel, mostly VCS independent)
  - Change parsing (parallel, highly VCS dependent)

This implements commit discovery for Mercurial, similar to git's parsing:

  - List the heads of all the branches.
  - If we haven't already discovered them, follow them back to their roots (or
the first commit we have discovered).
  - Import all the newly discovered commits, oldest first.

This is a little complicated but it ensures we discover commits in depth order,
so the discovery process is robust against interruption/failure. If we just
inserted commits as we went, we might read the tip, insert it, and then crash.
When we ran again, we'd think we had already discovered commits older than HEAD.

This also allows later stages to rely on being able to find Phabricator commit
IDs which correspond to parent commits.

NOTE: This importer is fairly slow because "hg" has a large startup time
(compare "hg --version" to "git --version" and "svn --version"; on my machine,
hg has 60ms of overhead for any command) and we need to run many commands (see
the whole "hg id" mess). You can expect something like 10,000 per hour, which
means you may need to run overnight to discover a large repository (IIRC, the
svn/git discovery processes are both about an order of magnitude faster). We
could improve this with batching, but I want to keep it as simple as possible
for now.

Test Plan: Discovered all the commits in the main Mercurial repository,
http://selenic.com/repo/hg.

Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran

Reviewed By: Makinde

CC: aran, Makinde

Differential Revision: 943
2011-09-16 11:08:52 -07:00
..
crossref Add symbol import scripts for crossref features 2011-09-13 08:49:44 -07:00
daemon Add a Mercurial commit discovery daemon 2011-09-16 11:08:52 -07:00
install Add a garbage collector daemon 2011-07-05 13:49:11 -07:00
mail Skip attaching 'inline' text attachments 2011-06-12 22:38:57 -07:00
repository Support Mercurial in test_connection.php 2011-09-15 14:50:29 -07:00
search Added subscriber view to Maniphest. 2011-07-07 14:08:52 -07:00
setup Test for pcntl availability from the command line, not Apache 2011-05-30 21:02:08 -07:00
sql Script to selectively convert MyISAM tables to InnoDB 2011-07-11 11:42:28 -07:00
user Mask typed passwords as they are entered into 'accountadmin' 2011-05-28 11:52:59 -07:00
__init_env__.php Set time zone for PhabricatorRepositoryCommitDiscoveryDaemon 2011-05-30 15:38:43 -07:00
__init_script__.php Create AphrontWriteGuard, a backup mechanism for CSRF validation 2011-08-16 13:29:57 -07:00
celerity_mapper.php Fix typo in Celerity mapper 2011-08-03 23:25:40 -07:00