mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
0565c7e244
Summary: For our HgExternalSync jobs that pull from git, we don't really use most of the bells and whistles of hggit. Notably, we don't care about bookmarks: we only ever pull master, we never update to it, we only ever look at `-r tip`. However, we do care about things that are actually much harder to fit in a world where we try to pretend the remote git repository is actually a hg repository we can pull from. Notably, we'd like to enforce limits on how many commits we pull (and convert) at a time, so that if we fall behind a little bit, we don't start falling even more behind by having to convert bigger and bigger batches of commits. If we're trying to pretend fetching from git and converting commits is actually a pull, then that seems harder to pull off (we'd need to somehow rewind the remote head we're pulling before importing it). So, this adds a new external-sync command to hggit that basically the bare minimum that we do need. It lets you specify a git remote and a head you care about, and import up to N commits from it. That's it — no bookmarks are updated or anything (but the git-mapfile is, of course). The only thing that changes is your commits. If you actually want to interact with your git repository on an ongoing basis as if it were a remote hg repository, this is completely useless, but that isn't what we actually do, so that should be OK. As part of this, I've modified a few other parts of git_handler to remove places where we called a `uri` `remote_name` (which is a bit confusing), and a place where we were asking for a `remote_name` parameter that I don't have here, but which we also didn't actually need (in `import_git_objects`). Reviewed By: farnz Differential Revision: D20836601 fbshipit-source-id: 96230e6e8269d0472404414948fd2f02aa98d79c |
||
---|---|---|
.. | ||
hgdemandimport | ||
hgext | ||
mercurial | ||
__init__.py | ||
__main__.py | ||
traceimport.py |