Commit Graph

1764 Commits

Author SHA1 Message Date
Zach Amsden
205a3b8a81 [fastlog-hg] Better multi-path and file support for fastlog
Summary:
The multi-path support is pretty shameful; we can
do much better by issuing multiple queries and combining
results.  File support was also missing.

Test Plan:
Ran fastlog test.  Need to update test to test files.

P56589012

Reviewers: quark, rmcelroy, durham

Reviewed By: durham

Subscribers: stash, mjpieters, jeroenv

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

Tasks: 12341014

Signature: t1:3726318:1471919354:e5e8f40a5b918b493e927c2d620da1fdefa1768c
2016-08-23 11:46:34 -07:00
Zach Amsden
fe94406e9a [fastlog-hg] Add localmatch function
Summary:
Bugfix - we were failing to check local patterns in the fastpath.
Pass a filtering function to the local log thread to limit its results.

Test Plan: Run local log

Reviewers: stash, quark, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12341014

Signature: t1:3727573:1471907418:37b83d6c02e61ce2705070c7a86dd815a1c1cb29
2016-08-23 11:46:34 -07:00
Zach Amsden
76529f6745 [fastlog-hg] Pass revfn
Summary: Pass revfn to the thread to unify response messages.

Test Plan: Run unit test, try fastlog

Reviewers: quark, durham, rmcelroy, stash

Reviewed By: stash

Subscribers: mjpieters

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

Tasks: 12341014

Signature: t1:3727506:1471855144:24e622c6add0584d37539ea5ee319e3454f5313e
2016-08-23 11:46:34 -07:00
Zach Amsden
31382f23a3 [fastlog-hg] Better handling of exceptions
Summary: Without this, exceptions are super hard to debug

Test Plan: Manually force exceptions with bogus array indices on non-arrays

Reviewers: quark, #mercurial, ttung, durham

Reviewed By: durham

Subscribers: stash, mjpieters

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

Tasks: 12341014

Signature: t1:3744317:1471919239:8c8d0fce6c212fd677df8b7f94a48d17dbe64b93
2016-08-23 11:46:34 -07:00
Jun Wu
36544a8c4d smartfixup: add an interactive mode
Summary:
Like `commit -i`, this diff adds an `interactive` mode. I'd like
to reuse some patching code but they are tightly coupled about
writing files to disk - while I want to handle everything in memory.

In the future I may want to add `memorystore` and `memorybackend`
to upstream's `patch.py`. But they are not available now therefore
the "patching" logic is a re-invent. Fortunately the logic is just
about 20 lines.

Test Plan:
Manually run `hg sf -i` with some manually crafted random cases.
Also make sure it works with both `text` and `curses` interfaces.

Reviewers: #mercurial, durham, ttung

Reviewed By: durham

Subscribers: durham, mjpieters

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

Signature: t1:3723179:1471582313:b10d278ca5b1a2aee6b41936f315a960edee92ed
2016-08-23 15:20:20 +01:00
Jun Wu
dea474ec1f smartfixup: add command line options to preview changes
Summary:
The `--print-changes` option will show which commit, a changed lines will be
applied to. Note it is a bit expensive so we only calculate the content when
being asked.

The `--dry-run` option will prevent the final commit operation.

Users can now use `-pn` to preview changes to understand what will be changed.

Test Plan: Run `test-smartfixup.t`

Reviewers: #mercurial, ttung, durham

Reviewed By: durham

Subscribers: mjpieters

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

Signature: t1:3719673:1471582117:7f3be3c3bf3829148c3d096d2aae6e7382449b98
2016-08-23 15:19:54 +01:00
Jun Wu
a51d83bec3 smartfixup: implement the command
Summary:
This is the last piece of the initial smartfixup implementation: the command.
A new test was added to test the command.

Test Plan: Run the newly added test

Reviewers: #mercurial, ttung, jbower, durham

Reviewed By: durham

Subscribers: akushner, simonfar, durham, jbower, mjpieters

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

Signature: t1:3717354:1471629588:202e4a5820de472eb131eb968ec73f194d2c077d
2016-08-23 15:19:29 +01:00
Jun Wu
0087ee33bf smartfixup: implement fixupstate
Summary:
If `filefixupstate` is to `filecontext`, `fixupstate` is to `context`.
This does the actual committing, creating obsmarkers, moving bookmarks work.

Test Plan: A new test will be included in the next diff

Reviewers: #mercurial, ttung, durham

Reviewed By: durham

Subscribers: durham, mjpieters

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

Signature: t1:3716954:1471639171:9891a0c64365b0592f5a4d86e3c83d521b4c5bb2
2016-08-23 15:18:36 +01:00
Jun Wu
7683c76566 smartfixup: implement filefixupstate
Summary:
The `filefixupstate` object maintains states and contains logic related to
do "smartfixup" to a single file.

Test Plan: Added a new test

Reviewers: #mercurial, ttung, durham

Reviewed By: durham

Subscribers: durham, mjpieters

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

Signature: t1:3716761:1471919159:033e79e9d12307785863959dd5d82a7c3c647ff3
2016-08-23 15:17:42 +01:00
Jun Wu
98861bc86e smartfixup: add utilities
Summary:
This series is a rewrite of D3264203, using the `linelog` instead of
`histedit`. The new version has the following advantages:

  - handle more cases where it could be a merge conflict with a traditional
    merge algorithm. the old code tries to "predict" when a merge won't
    cause conflicts. but that's just kinda stupid - comparing with the new
    code using linelog - it is just impossible to produce merge conflicts.
  - do not touch working copy - all intermediate calculations and states are
    in memory. say goodbye to the clean working copy requirement of histedit.
  - handle line numbers cleanly and confidently - the old code struggles (but
    failed) to make line numbers correct after each edits, while it is
    actually hard as the "merge" operation could change line numbers in an
    unpredictable way. the new code using linelog can just edit chunks from
    an old revision, from the latest view without checking out that old
    revision first. therefore no need to mess up with line numbers.

This diff adds utility functions and classes used later. It introduces
unused `import`s but they will be used later.

Test Plan: `arc lint`

Reviewers: #mercurial, ttung, durham

Reviewed By: durham

Subscribers: durham, mjpieters

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

Signature: t1:3716758:1471556512:0fbff8f6fe4bc02d2120c723d2cc28676895c679
2016-08-23 15:16:15 +01:00
Adam Simpkins
b1540c8b8a Fix hgext3rd/__init__.py to make sure it is a namespace package
Summary:
According to the comments hg-crew, hgext3rd is supposed to be a namespace
package, so that extensions can be found in multiple different hgext3rd
directories.

However, the hgext3rd directory in fb-hgext has an empty __init__.py file,
which turns hgext3rd into a plain package instead of a namespace package,
preventing other hgext3rd directories from being found.

This fixes the __init__.py file to perform proper namespace package
initialization, as is done in the hg-crew/hgext3rd/__init__.py file

Test Plan:
Deployed this file on my server and confirmed that extensions in other hgext3rd
directories in $PYTHONPATH are still found correctly.

Reviewers: rmcelroy, durham, quark

Reviewed By: quark

Subscribers: net-systems-diffs@, yogeshwer, mjpieters

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

Tasks: 12792845

Signature: t1:3746098:1471679643:44a274807d3598a670e1742dee4cc2654f6bad97
2016-08-22 17:39:02 -07:00
Zach Amsden
bdc73e2393 [fastlog-hg] Remove limit on threads
Summary:
Limits make no sense anymore because we may be filtering
the results further.

Test Plan: fastlog unit test, run extension against fbsource

Reviewers: quark, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12341014

Signature: t1:3743974:1471906692:25f48349bd70781219acdc3cf6b98134035d6236
2016-08-22 16:23:10 -07:00
Zach Amsden
64d75b4864 [fastlog-hg] Get patterns working again
Summary:
When the restriction of only working on a single directory
was dropped, pattern support was neglected.  That has to be done through
a revset, not the looser matches() filter.

Test Plan: P56588753

Reviewers: rmcelroy, quark, stash, durham

Reviewed By: durham

Subscribers: mhammell, meisner, calcsaransh, gqchen, dzhulgakov, kerl, bnitka, mjpieters

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

Tasks: 12341014

Signature: t1:3734232:1471906628:d3995b358d683383fe590fa5848d8450a0ea05dd
2016-08-22 16:21:43 -07:00
Tony Tung
de4ad14a9c [ctree] make path a reference in diff
Summary: It's a fixed reference that we use, so no need for a pointer.

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/lz4revlog/ /opt/local/bin/python2.7 ~/work/mercurial/facebook-hg-rpms/hg-crew/hg --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "master~5::master"`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3753463:1471905506:802315db9d2aa34363c7b0bccaefcbcda21b1a1e
2016-08-22 15:47:46 -07:00
Tony Tung
aab04b7fcf [ctree] have ManifestIterator::next return the entry directly
Summary: Since we're no longer returning a struct, we no longer need to return the value through a pointer argument.

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/lz4revlog/ /opt/local/bin/python2.7 ~/work/mercurial/facebook-hg-rpms/hg-crew/hg --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "master~5::master"`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Tasks: 12818084

Signature: t1:3752376:1471891162:e7cc159d2077d77d234902e4598b9661f15840c0
2016-08-22 15:47:31 -07:00
Tony Tung
fc7dffd109 [ctree] change the ManifestIterator to return ManifestEntry *
Summary: This allows us to modify the ManifestEntry stored in memory.  This also requires us to remove the const qualifier in a number of places.

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/lz4revlog/ /opt/local/bin/python2.7 ~/work/mercurial/facebook-hg-rpms/hg-crew/hg --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "master~5::master"`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Tasks: 12818084

Signature: t1:3752366:1471891101:1d42a04d85b7e8db34644dc8fbf1bb3481fbb7bc
2016-08-22 15:47:16 -07:00
Tony Tung
a3b14127d3 [ctree] extract treemanifest code to its own file
Test Plan: make local

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3733819:1471542946:8b322a7099eceb41826bb9e0edeca52e2daceb4c
2016-08-22 15:45:06 -07:00
Tony Tung
4b9e4ad3ee [ctree] rename treemanifest.cpp to py-treemanifest.cpp
Summary: py-treemanifest.cpp will be mostly just python binding stuff.

Test Plan: make local

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3733832:1471542792:d6f1130b5c16487f4d0173cedd91857fd3711c1d
2016-08-22 15:44:50 -07:00
Tony Tung
e953a3cc27 [ctree] get rid of manifestkey
Summary: Directly pass in the path + len and the node.  Note that the path is now a char* + len, because this allows us to use the path in treemanifest_find directly, rather than to construct a new path.

Test Plan: run existing perftest without crash.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3738280:1471890923:c13283f1c61dc020ba1918ee9b25c24dfd2fc19b
2016-08-22 15:42:03 -07:00
Tony Tung
8205ab233f [ctree] methods to find and add children
Test Plan: used in later diff.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3732102:1471905481:000ff5d976c348bac9f993f9c0b56f4b9c8b84f0
2016-08-22 15:41:52 -07:00
Tony Tung
33f0d41725 [ctree] modularize the code
Summary:
I like many small files.

There is one place where I'm making a functional change (convert.h) to satisfy angry compilers.

Test Plan: make local.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3732584:1471542758:d0b7804753ea4fd39a507090338ae3c5104dc7fa
2016-08-22 15:40:56 -07:00
Zach Amsden
cde79943b1 [fastlog-hg] For now, import os is still required
Summary: Accidentally removed this dependency too soon

Test Plan: Run fastlog on fbcode; broken before, now fixed

Reviewers: durham, quark, stash

Reviewed By: stash

Subscribers: mjpieters

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

Tasks: 12341014

Signature: t1:3743884:1471853021:ce470e4e42aa1c07aed624285a81824e04e70668
2016-08-22 14:46:39 -07:00
Zach Amsden
a011ca516b [fastlog-hg] More extensive fastlog test
Summary:
More extensive test to make sure existing behavior isn't broken.
What is broken currently - globs.

Test Plan: ../../hg/run-tests.py test-fastlog.t

Reviewers: durham, quark, stash

Reviewed By: stash

Subscribers: stash, mjpieters

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

Tasks: 12341014

Signature: t1:3743677:1471852994:7684524f1879e6ac16d473cabd53e95adf73d888
2016-08-22 14:42:39 -07:00
Tony Tung
b05f64d3f0 [ctree] add constructor for ManifestEntry that allocates memory and places its data
Summary: For adding new children to Manifests, we need to be able to create new ManifestEntries.  Since these ManifestEntries will not be backed by datapack data structures, we need ManifestEntries that have its own memory allocation.

Test Plan: used in later diff.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3732101:1471541200:17b60af0977109757610168637a276f5dd999f8b
2016-08-22 13:58:42 -07:00
Tony Tung
f22b6105d5 [ctree] remove hack for clang
Summary: D3730823 removes the need for it.

Test Plan: compiles

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mathieubaudet, mitrandir

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

Signature: t1:3730880:1471467917:2b202c5cab1a10fcfe5899670b11bc44740983f7
2016-08-22 13:58:10 -07:00
Tony Tung
efd9e50796 [ctree] remove dead code
Summary: This is not used.

Test Plan: compiles

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3726149:1471401105:3c27f091b180dd14493a3e50d4043b10b077142b
2016-08-22 13:57:58 -07:00
Tony Tung
fd38308160 [ctree] add a Manifest pointer to ManifestEntry
Summary:
If a manifest has already been loaded for a ManifestEntry, we should cache that entry and reuse it.  Two reasons:

1) if someone makes a modification to a tree, we need to persist that.
2) better performance.

Missing in this diff: memory cleanup

Test Plan: compiles

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3725842:1471401136:cbf4a987c35ea19ca432059cc15e299f0aa5568b
2016-08-22 13:57:41 -07:00
Tony Tung
f1ce770ce5 [ctree] convert ManifestFetcher to standard declaration + definitions layout
Summary: This allows us to use ManifestFetcher inside the ManifestEntry class.

Test Plan: compiles

Reviewers: #fastmanifest, durham

Subscribers: durham, mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D3725838
2016-08-22 13:55:43 -07:00
Tony Tung
71837a8c16 [ctree] transact in manifests rather than manifestkeys
Summary: This will allow us to replace portions of manifests with in-memory representations.

Test Plan: existing script doesn't crash.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3725831:1471400740:4d9891c01f8567f4ceab76d6bd36e7dc595de4a6
2016-08-22 13:55:19 -07:00
Tony Tung
0727c6d030 [ctree] remove the need for a nextentrystart by returning the end of the entry
Summary: `parseptr` refers to where the parsing is going next.  This simplifies the code and makes ManifestEntry less tied to the original memory allocation.

Test Plan: the existing test i've been running doesn't crash.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3717940:1471383988:9b718e137b8ffaf8aad09f78f15791eec57fce6e
2016-08-22 13:42:55 -07:00
Tony Tung
dc8b5e0229 [ctree] parse manifests at load time
Summary: Parse manifests when we construct the Manifest object.  This allows us to do manipulations to the Manifest object and not have to deal with a parallel set of data structures.

Test Plan:
`PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/ valgrind ~/work/mercurial/facebook-hg-rpms/hg-crew/hg  --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "@~2::@"`

note that I'm running this with Valgrind.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3717936:1471383856:012634c1e59f1da9fc1e5a918e7f7d99d30d6992
2016-08-22 13:42:40 -07:00
Tony Tung
4245bfb5d8 [ctree] get rid of unused index field
Summary: It's not necessary for the direction we're going in.

Test Plan: compiles

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3717930:1471383901:d8bfddb7ea7fb08d26315cbfce7af65d14662bc8
2016-08-22 13:42:27 -07:00
Tony Tung
56a6784b4d [ctree] Manifest objects are now allocated on the heap to permit them to be persisted
Summary:
We need manifest objects to be able to stick around in memory, because now they have overrides and all that other good stuff.

This probably introduces a metric ton of memory leaks, but we'll slowly whittle them down.

Test Plan: same script.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3717304:1471385439:9269ab248d233a970c6725dbb4ca3eb661f6a96e
2016-08-22 13:41:27 -07:00
Tony Tung
a89dcaf23f [ctree] remove InMemoryManifest
Summary: All manifests will be in-memory to simplify the design.

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/ ~/work/mercurial/facebook-hg-rpms/hg-crew/hg  --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "@~2::@"`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3717296:1471383272:0fca293beaf811ef39de87300437b0bf880e1ca7
2016-08-22 13:40:57 -07:00
Tony Tung
25b86ae774 [ctree] use a common idiom for naming structures
Summary: xxx is the C++ class, py_xxx is the python wrapper for it.

Test Plan: make local

Reviewers: #fastmanifest, akushner

Reviewed By: akushner

Subscribers: mitrandir

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

Signature: t1:3701536:1471150787:5f3dfc3a65360233f9ee2ea1757ed4f368f70d62
2016-08-22 13:40:15 -07:00
Tony Tung
ff44d5f816 [ctree] handle construction and destruction in treemanifest object
Summary: py_treemanifest is initialized to 0s.  We initialize the `tm` field by explicitly calling the constructor in `treemanifest_init` and we destroy everything by explicitly calling the destructor in `treemanifest_dealloc`

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/lz4revlog/ /opt/local/bin/python2.7 ~/work/mercurial/facebook-hg-rpms/hg-crew/hg --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "master~5::master"` in fbsource

Reviewers: #fastmanifest

Subscribers: mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D3730823
2016-08-22 13:39:35 -07:00
Tony Tung
536f6aaaee [ctree] create a py_treemanifest struct that handles the exclusively-python stuff
Summary: treemanifest will become the C++-only treemanifest object.

Test Plan: `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/ ~/work/mercurial/facebook-hg-rpms/hg-crew/hg  --config extensions.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "@~2::@"`

Reviewers: #fastmanifest, durham

Subscribers: durham, mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D3701468
2016-08-22 13:37:53 -07:00
Zach Amsden
f115cd74e9 [fastlog-hg] Remove unused imports
Summary: No need for cruft

Test Plan: Load in Atom, no more complaints about unused imports

Reviewers: durham, rmcelroy, quark

Reviewed By: quark

Subscribers: mjpieters

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

Tasks: 12341014

Signature: t1:3733509:1471519620:08e896aaff65b545d7d16e5d46ba6a8e2a2bc186
2016-08-19 11:59:10 -07:00
Tony Tung
11823e1845 [ctree] move conversion methods to convert.h
Summary:
yo refactoring.

Depends on D3699264

Test Plan: compiles

Reviewers: #fastmanifest, akushner

Reviewed By: akushner

Subscribers: mitrandir

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

Signature: t1:3699498:1471151476:b08a69fb474413c9fc780eaffba4058aca00dacc
2016-08-18 14:44:26 -07:00
Tony Tung
3dbcbb215f check-code: fix errors that have creeped in
Test Plan: run check-code

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3733781:1471542457:bccf5d849931040f5168b64185e0eb61d94dbece
2016-08-18 14:38:54 -07:00
Jeremy Fitzhardinge
1fd4455c73 Implement 'hg uncommit'
Summary:
TODO:
 - fix handling of empty commit (leaves stray heads)
 - add tests

Test Plan: Add mercurial unit tests

Reviewers: #mercurial, ttung, rmcelroy, durham

Reviewed By: durham

Subscribers: quark, rmcelroy, mjpieters

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

Tasks: 12340638

Signature: t1:3610409:1471398045:355f20502d917374e99feee4681a7ef6f853ad6c
2016-08-17 13:43:25 -07:00
Jun Wu
08ac5e7826 setup: check Cython version
Summary:
The minimal version of Cython to build linelog is 0.22. Add a check so people
know it's not a source code issue, but Cython needs upgrade.

Test Plan:
Run with different Cython releases and make sure it complains when Cython
version < 0.22. Also make sure it works with strange versions like "0.25a1".

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:3706559:1471463690:92b981e2df63ad63ab55edb5e0b937455254351d
2016-08-17 20:55:54 +01:00
Tony Tung
8894da1d35 [ctree] fix comments for clarity/grammar
Test Plan: meh.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3718053:1471384016:be6ad07218e90e03708eae3c9f8a9bc4b1c67520
2016-08-17 12:42:42 -07:00
Tony Tung
1f25a00b79 [ctree] fix comment style
Summary: Matches javadoc/doxygen style

Test Plan: compiles

Reviewers: #fastmanifest, akushner

Reviewed By: akushner

Subscribers: akushner, mitrandir

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

Signature: t1:3699264:1471152249:d917e1f53426ace7b2e26df2cc72379fa97f93c1
2016-08-17 12:41:54 -07:00
Tony Tung
1083a7147d [ctree] if the flag is unset, return the null character as the flag
Summary: If the flag is not present, then `flag` field is set to NULL.  In that case, the current code will segfault.  Now we will assign `\0` to `*resultflag`.

Test Plan:
run `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotefilelog:~/work/mercurial/facebook-hg-rpms/fb-hgext/:~/work/mercurial/facebook-hg-rpms/remotenames/ ~/work/mercurial/facebook-hg-rpms/hg-crew/hg  --config extens
.perftest=~/work/mercurial/facebook-hg-rpms/remotefilelog/tests/perftest.py testtree --kind flat,ctree,fast --test fulliter,diff,find --build "@~2::@"`
 without crashing.

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3700352
2016-08-17 12:37:19 -07:00
Tony Tung
d1a61c4d0f [ctree] move the treemf reference up to fileiter
Summary: This is the first step in disentangling the C++ code from the python interface.

Test Plan: `PYTHONPATH=~/remotefilelog/build/lib.linux-x86_64-2.6/ python ~/hg/hg --config extensions.remotefilelog=~/remotefilelog/remotefilelog --config extensions.perftest=~/remotefilelog/tests/perftest.py testtree --kind flat,ctree --test fulliter,diff,find --build "master~5000::master"`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:3700627:1471382403:d8dc6dc5c295ec55878ca020b91fc0b30d930ce8
2016-08-17 11:48:01 -07:00
Tony Tung
c882541a19 CMakeLists.txt to build both ctreemanifest and cdatapack
Summary: Useful if you run CLion.

Test Plan: built everything.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir

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

Signature: t1:3700542:1471382263:260eb0a1588480f1d4c798df60d559c63ed19c8a
2016-08-17 11:42:31 -07:00
Zach Amsden
092d645baa Fix comment for fastlog
Summary: Document how to enable the extension

Test Plan: Set this in my actual .hgrc and confirm it works.

Reviewers: durham, rmcelroy, quark

Reviewed By: quark

Subscribers: mjpieters

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

Signature: t1:3721128:1471342825:e274764e036f1c03b9f8795221af6fe587990340
2016-08-16 15:55:48 -07:00
Jun Wu
fab3975b47 sshaskpass: use mkdtemp to create temporary directory
Summary:
Before this patch, sshaskpass has a hardcoded tmp directory, which, if being
abused, can break sshaskpass from working. This diff fixes the issue by
using tempfile.mkdtemp.

Test Plan:
Run `chg push -r . ssh://root@localhost//tmp/foo -f --allow-ano` and make
sure ssh password prompt works. Also run the sshaskpass test.

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:3705674:1471373405:aec54ac685b060efb616307552cebcccee5cebe8
2016-08-16 19:51:47 +01:00
Tony Tung
5d5892a422 update .hgignore
Summary: .idea is the CLion project directory.  .testtimes is dropped by the linter.

Test Plan: minimal

Reviewers: #fastmanifest, akushner

Reviewed By: akushner

Subscribers: mitrandir

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

Signature: t1:3700563:1471150982:79e96a7f8930c6417fa528375884d288ab661a6a
2016-08-15 11:43:02 -07:00