sapling/hggit
Siddharth Agarwal 6b4e5f67db hg2git: fix subrepo handling to be deterministic
Previously, the correctness of _handle_subrepos was based on the order the
files were processed in. For example, consider the case where a subrepo at
location 'loc' is replaced with a file at 'loc', while another subrepo exists.
This would cause .hgsubstate and .hgsub to be modified and the file added.

If .hgsubstate was seen _before_ 'loc' in the modified/added loop, then
_handle_subrepos would run and remove 'loc' correctly, before 'loc' was added
back later. If, however, .hgsubstate was seen _after_ 'loc', then
_handle_subrepos would run after 'loc' was added and would remove 'loc'.

With this patch, _handle_subrepos merely computes the changes that need to be
applied. The changes are then applied, making sure removed files and subrepos
are processed before added ones.

This was detected by setting a random PYTHONHASHSEED (in this case, 3910358828)
and running the test suite against it. An upcoming patch will randomize the
PYTHONHASHSEED in run-tests.py, just like is done in Mercurial.
2014-02-19 20:52:59 -08:00
..
help docs: update to correctly reflect that local git repositories are supported 2012-09-13 20:57:37 -04:00
__init__.py gitnodekw: use githandler from repo 2014-02-19 15:23:36 -08:00
_ssh.py Upgraded to use latest version of dulwich (0.9.1). 2013-09-13 01:42:27 +01:00
git_handler.py git_handler: terminate new commit DAG traversal at known commits 2014-02-18 20:30:27 -08:00
gitdirstate.py gitdirstate: import errno for handling OSError 2014-02-07 10:43:49 -05:00
gitrepo.py gitrepo: drop unused _initializehandler function and handler property 2014-02-19 15:11:14 -08:00
hg2git.py hg2git: fix subrepo handling to be deterministic 2014-02-19 20:52:59 -08:00
hgrepo.py hgrepo.tags: use githandler property 2014-02-19 14:16:40 -08:00
overlay.py overlay: add kludge to make sure we only ever give hexshas to dulwich 2013-12-13 12:54:39 -05:00
util.py submodules: only use the ordereddict backport if collections.OrderedDict is unavailable 2012-08-28 09:09:01 -05:00