Commit Graph

5 Commits

Author SHA1 Message Date
Durham Goode
5bebd357b5 hgsubversion: fix directory tree pattern matching
Summary:
Match patterns don't work the way I expected. They require the path to
not have '/' at the end, and they don't seem to match when a file or sub
directory is appended. Fix it by setting default to 'path'.

```
> matchmod.match("", "/", patterns=['foo/'])('foo/bar')
False
> matchmod.match("", "/", default='path', patterns=['foo/'])('foo/bar')
True
```

Reviewed By: quark-zju

Differential Revision: D13332653

fbshipit-source-id: e0f3fa9a51d36a40ac8a9c54f73296f431536d3c
2018-12-04 19:12:37 -08:00
Durham Goode
6040777902 hgsubversion: improve performance with treemanifests
Summary:
hgsubversion has some logic that tries to read the list of files in a
given directory. In a tree-only world, it turns the entire tree into a text
file, then splits it by line and bisects over it.

Let's instead use the walk function, which is optimized for this kind of thing
on trees.

Reviewed By: quark-zju

Differential Revision: D12969497

fbshipit-source-id: ef3af9e0022978d6a4922cbb464bfd14248f5501
2018-11-16 11:06:09 -08:00
Jun Wu
a487dacc4b codemod: reformat rest of the code
Summary:
Previous code format attempt (D8173629) didn't cover all files due to `**/*.py`
was not expanded recursively by bash. That makes certain changes larger than
they should be (ex. D8675439). Now use zsh's `**/*.py` to format them.

Also fix Python syntax so black can run on more files, and all lint issues.

Reviewed By: phillco

Differential Revision: D8696912

fbshipit-source-id: 95f07aa0c5eb1b63947b0f77f534957f4ab65364
2018-07-05 17:52:43 -07:00
Durham Goode
cf6bb5a80a hg: speed up hgsubversion imports
Summary:
Previously every time a directory was deleted in subversion it would
call delete_entry which contained a ctx.walk() that would iterate over the
entire manifest. When many directories were deleted, this was
O(directories_deleted * size_of_repo) and very slow.

The new algorithm uses bisect to avoid iterating over the entire manifest.

Reviewed By: quark-zju

Differential Revision: D7529670

fbshipit-source-id: 763c1ad5ad46929d878848d150542f255ad96dd4
2018-04-13 21:51:48 -07:00
Mateusz Kwapich
ba6e9cd752 hgsubversion: move hgsubversion/hgsubversion to hgext
Summary: Move's the extension code into hgext/

Test Plan: Tests are fixed in a later commit.

Reviewers: quark, #mercurial

Reviewed By: quark

Differential Revision: https://phabricator.intern.facebook.com/D6698506

Signature: 6698506:1515628404:0006a07cef299eb3cd719f2fc0d5d381fdc2a3d5
2018-01-10 16:19:46 -08:00