Commit Graph

798 Commits

Author SHA1 Message Date
Laurent Charignon
84c24b6984 test: match new quoting conventions in core
Summary:
Core changed the quoting convention in some of the warning messages,
this patch makes fb-hgext up to date with these new conventions.

Test Plan: the tests failing before are passing now

Reviewers: durham, quark, mitrandir

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3198601

Tasks: 10906174
2016-04-19 15:33:58 -07:00
Tony Tung
1b1ca009aa [fastmanifest] compile with c99
Summary: Living dangerously with a C standard from only 17 years ago!!

Test Plan: make local

Reviewers: #sourcecontrol, akushner

Reviewed By: akushner

Subscribers: akushner, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3198536

Tasks: 10906159

Signature: t1:3198536:1461103465:3415d87269f703c5cbab51ab3e54f05de6f5b963
2016-04-19 15:05:29 -07:00
Laurent Charignon
7c3180d675 fastmanifest: fix singleton pattern 2016-04-19 14:08:13 -07:00
Jun Wu
a57b447851 runcheckcode: make lz4revlog an optional requirement
Summary:
Before this patch, `runcheckcode.sh` sets an extra config option
`extensions.lz4revlog=`, which will break if lz4revlog is not installed
in the system. This patch drops the config option if the repo does not
require `lz4revlog`.

Test Plan: Run `runcheckcode.sh` in both lz4revlog and non-lz4revlog repos.

Reviewers: #sourcecontrol, ttung

Reviewed By: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3196200

Signature: t1:3196200:1461088741:11cfc8f3236f471e060e768c01a772072543e6fc
2016-04-19 11:00:44 -07:00
Jun Wu
a6e1589c4f errorredirect: wrap handlecommandexception instead of sys.exit
Summary:
Since `handlecommandexception` is in core, wrap it to suppress original
crash text, instead of doing an ugly `sys.exit()`. It's much simpler and
cleaner than before. It also fixes an issue with current chg since chgserver
will print an traceback when it encounters SystemExit.

Although `logtoprocess` are doing very similar things with `errorredirect`,
it currently cannot replace `errorredirect` because we need synchronized
behavior to return the user to their shell prompt correctly. If we can get
the synchronized behavior and a way to disable builtin warning (may be tricky)
in `logtoprocess` upstream, the `errorredirect` extension could be just a thin
wrapper around `logtoprocess` using `setconfig`.

Besides, we no longer need `suppresscommandfailure` since the feature will
be either in `errorredirect` or `logtoprocess`.

Test Plan:
Run `hg crash` with `errorredirect.script` set to confirm it is compatible
with the old behavior.

Also run unittest `test-errorredirect.t`

Reviewers: #sourcecontrol, ttung, mjpieters

Reviewed By: mjpieters

Subscribers: rmcelroy, durham, lcharignon, mjpieters

Differential Revision: https://phabricator.fb.com/D3191840

Signature: t1:3191840:1461088280:77febd539c2f38a55778af3977738c045f63a0d8
2016-04-19 10:59:22 -07:00
Jun Wu
bcb27edfa9 Refactoring rage.py
Summary:
A couple of clean-ups for rage.py. They are small and easy to review so I'm doing it in one diff:

- Change the default behavior to print instructions asking for help in the support group.
  Since only about 20 hg rage (not counting test ones) tasks are created last year.
  The old behavior of creating tasks is still accessible by using the `--oncall` flag.
- Collect more information:
  - `hg sparse`
  - `hg version`
  - `obsstore size`
  - `rpm -q mercurial`
  - network information
  - short `hg config` only including local configs
- Adjust the order of detailed message, move hg config down since it's very long.
- Remove atexit error printer. Instead, put them in rage info directly.
- Fix code style: remove underscores in variable names, remove unnecessary indentation.
- Mark it FBONLY since it uses `tasks` and `oncalls` which are not available outside.

Test Plan:
Make sure these all work as expected:

  hg rage
  hg rage --preview
  hg rage --oncall

Reviewers: #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: ikostia, ttung, rmcelroy, simonfar, mjpieters, sid0

Differential Revision: https://phabricator.fb.com/D3138673

Tasks: 10654995, 10332733

Signature: t1:3138673:1461070413:4547d8b7e438035d6af73a49094c10eab725af0d
2016-04-19 06:04:42 -07:00
Martijn Pieters
58d4cb362d Fix graphmod-related test failures
Summary:
This change fixes up tests to track graphmod changes.

The change for the smartlog test is a temporary stop-gap measure, as smartlog
itself will be updated soon to track the changes in better ways.

Test Plan:
Run the test-suite, ignore unrelated failures in test-morestatus.t, test-mergedriver.t
and test-fastmanifest.t

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3191336

Tasks: 10804976
2016-04-19 11:19:20 +01:00
Tony Tung
49272cddf4 [fastmanifest] integrate the c library with fastmanifest_wrapper
Test Plan: pass @lcharignon's simple manifest test (D2989398) with this

Reviewers: #sourcecontrol, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, lcharignon

Differential Revision: https://phabricator.fb.com/D3193368

Tasks: 10589033

Signature: t1:3193368:1461015983:6122bf0565483830cd3bac00f838785f7ac346b7
2016-04-18 15:40:42 -07:00
Tony Tung
10bed408cb [fastmanifest] implement contains_path
Summary: It's like get_path, except with a simpler outcome.

Test Plan: passes @lcharignon's test

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, lcharignon, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3193277

Signature: t1:3193277:1461015712:2eace81a2ac6b4a08ee84de0cf19b7471b740362
2016-04-18 15:40:15 -07:00
Tony Tung
4d4cb59574 [fastmanifest] rename copy to copy_tree
Summary: It's too common of a name.

Test Plan: compiles && unit tests pass.

Reviewed By: lcharignon

Differential Revision: https://phabricator.fb.com/D3192722
2016-04-18 13:23:42 -07:00
Laurent Charignon
39c9749c80 fastmanifest: add debug mode for testing fastmanifest for all operations
Summary:
This patchs adds a debug flag to test fasmanifest for all operations.
It also fixes the module declaration in the fastmanifest_wrapper

Test Plan: Test pass

Reviewers: ttung, durham, rmcelroy

Differential Revision: https://phabricator.fb.com/D3186826
2016-04-18 13:18:04 -07:00
Tony Tung
4294090e19 [fastmanifest] initialize flags to 0 for directory nodes
Summary: They are never read normally, except for checksum calculation.  However, we cannot let them be free-floating values because they'll affect the checksums and give us incorrect results.

Test Plan: passed a test (in a later diff) without triggering valgrind

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3155436

Tasks: 10644245

Signature: t1:3155436:1460106747:9b6281490d8fe8cfeeeac8036ca7ca8e68f256d8
2016-04-18 11:40:46 -07:00
Tony Tung
305e73449d [fastmanifest] eliminate the alloc-realloc cycle from immediate node expansion
Summary: When we create new intermediate nodes as part of add_or_update_path, we add them with max_children=0.  However, the next action we do is to add a child, which immediately forces us to expand the node we just created.  This is wasteful.  We will now hint how many children the node is likely to have.  0 if it's a leaf node, or 1 if it's an intermediate node.

Test Plan: passed unit tests

Reviewers: lcharignon, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3155429

Signature: t1:3155429:1460120985:eb7ba4a3731c717fa6a9c61597a0fc980caa7589
2016-04-18 11:40:15 -07:00
Tony Tung
aaf816f8ea [fastmanifest] clone_node fails to copy all metadata
Summary: It doesn't copy the checksum_sz and flags fields over.  This is a serious problem as they are used in checksum calculation.

Test Plan: wrote unit test to verify the metadata is copied over.  failed.  updated code to copy the metadata over.  tests pass!

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3155393

Tasks: 10644245

Signature: t1:3155393:1460136520:10d75c5181eda88139df26d57a560af95f8ed69d
2016-04-18 11:37:14 -07:00
Tony Tung
7f08e8b0fa [fastmanifest] move tree state changes data structure to tree_path.h
Summary: It's only used internally, so it doesn't need to be in tree.h

Test Plan: passed unit tests.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3151313

Signature: t1:3151313:1460139292:ac5918f0d7249c81c31537396434f9b04c4a5a8f
2016-04-18 11:36:43 -07:00
Tony Tung
0713484f88 [fastmanifest] test that checksums for ancestor directory nodes are invalidated after updates
Summary: When we add or remove something to a path, we need to ensure that all the directory nodes leading to that path entry have their checksums invalidated.  This test verifies that behavior, and ensures that directory nodes that do *not* lead to the path entry are not invalidated.

Test Plan: pass unit test.  found the bug in D3143825

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3143832

Tasks: 10697482

Signature: t1:3143832:1460587147:1948e6c01a2799d5010174ff8be22830f0cb9c53
2016-04-18 11:35:19 -07:00
Tony Tung
3b4e9b3313 [fastmanifest] invalidate checksums after a successful add_or_update_path
Summary: If the changes metadata structure is not updated, then we will not update the directory nodes as we walk up.

Test Plan: pass a unit test in a later diff.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3143825

Tasks: 10697482

Signature: t1:3143825:1459971608:9e5d91bf80020cf71cfc5aca6fb72c8cc67dce59
2016-04-18 11:34:49 -07:00
Tony Tung
f8cae10edb [fastmanifest] benchmark checksum calculation
Summary: Not sure it's functional, but once it is, it's benchmark-able!

Test Plan: compiles and runs.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3141571

Signature: t1:3141571:1460071270:5bbb1d32bd97406d2cfd88955fabe29763132c7b
2016-04-18 11:34:30 -07:00
Tony Tung
e231b3320d [fastmanifest] fix the checksum update mechanism
Summary: Incremented the wrong value.  Caught this when running a unit test to update the checksum of an empty tree.

Test Plan: passes unit test now.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3140684

Tasks: 10697482

Signature: t1:3140684:1459903366:be1b970281e0df91b2a62e7fac2c1d417a8be221
2016-04-18 11:34:01 -07:00
Tony Tung
495ee1e2c7 [fastmanifest] initialize_node doesn't need the max_children
Summary: It's unused.  Get rid of the parameter.

Test Plan: pass unit tests

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3140664

Signature: t1:3140664:1460070644:047933753763797fe40504bc1cf883e4f8f8adc7
2016-04-18 11:33:28 -07:00
Tony Tung
da7b2357da [fastmanifest] fix misnomer in cmake file
Summary: Since I'm adding a .c file, TEST_HEADER_FILES is not really an accurate description.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3140374

Signature: t1:3140374:1460071293:77e11a27249196564f2ee816cc50e67951325a75
2016-04-18 11:33:08 -07:00
Tony Tung
a40ffad87d [fastmanifest] add mechanism to peek at directories in tests
Summary: I need this to be able to access directory nodes for checksum testing.

Test Plan: passed unit tests

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3140368

Tasks: 10697482

Signature: t1:3140368:1460584956:671cd08ca174795445a297ef75bee53d9f09a8ad
2016-04-18 11:32:31 -07:00
Martijn Pieters
508b666e12 logtoprocess: remove upstreamed extension
Summary: logtoprocess is now in core mercurial as an experimental extension.

Test Plan: -

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3191121

Tasks: 10805001
2016-04-18 16:08:58 +01:00
Martijn Pieters
567f9cd73e Prepare for hgwatchman being replaced by fsmonitor
Summary:
Support both fsmonitor and hgwatchman for now, until fully rolled over to
fsmonitor.

Test Plan:
Run $HG/tests/run-tests.py test-sparse-extensions.t (disable simplecache lines
if not installed to ensure the fsmonitor test at least runs).

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3174946

Tasks: 10804941
2016-04-14 10:59:05 +01:00
Laurent Charignon
351a2dad58 fastmanifest: End to end proof of concept
Summary: This adds end to end proof of concept of manifest caching supporting
different manifest type

Test Plan: Added a test

Reviewers: ttung, durham

Differential Revision: https://phabricator.fb.com/D3129530
2016-04-12 14:00:35 -07:00
Laurent Charignon
241ee64cb8 fastmanifest: remove flaky test
Summary:
We got the diagnosis information confirming our assumption but the
test is flaky and outputs different results every time. Let's remove the flaky
part of the test.

Test Plan: The test pass always

Reviewers: durham, rmcelroy, quark

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3163545
2016-04-12 14:00:35 -07:00
Martijn Pieters
97461f85be Remove upstreamed automv extension
Summary:
The automv extension is now in mercurial core. Both dev servers and laptops
already use the upstream extension.

Test Plan:
run `hg debugextensions --config "extensions.automv=" --debug | grep automv` to
confirm that the extension is loaded from `hgext`.

Reviewers: #sourcecontrol, ttung, quark

Reviewed By: quark

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3162775

Signature: t1:3162775:1460388914:20c5afff1dbf191fde476b6f8d2a210e83d33742
2016-04-12 10:11:01 +01:00
Laurent Charignon
f316c4b25d Add missing content from previous diff D3115446 2016-04-11 11:13:14 -07:00
Tony Tung
b65983a069 [fastmanifest] exempt tree-path.[ch] from check-code
Test Plan: arc diff makes me run check code.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3160496

Signature: t1:3160496:1460220444:7510cd4929d2fb7f5a42dd09dc890e036ad455bd
2016-04-10 00:18:56 -07:00
Tony Tung
a23d34c3e4 [fastmanifest] extract tree path traversal code to tree_path.[ch]
Summary: I'm planning on building a find_path traversal that exposes directories, and make it available for tests.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3138945

Signature: t1:3138945:1460071138:3eb43a1742c8b0d856f0b97421eb499d9e328310
2016-04-08 22:34:43 -07:00
Tony Tung
8db7c5eb12 [fastmanifest] rename tree_add_child() test to avoid possible conflict
Summary: It's also in tree.c.  Right now, it's a static function, but I'm planning on make it non-static.

Test Plan: pass unit tests

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3138923

Signature: t1:3138923:1460071054:9105ffcbff2b4330faf22652755dc28d8313c5e2
2016-04-08 22:34:24 -07:00
Tony Tung
3525719552 [fastmanifest] get_path should not return directories
Summary: As far as the consumers of this library are concerned, directories are a non-entity.

Test Plan: wrote a unit test.  unit test fails.  made the change in `test.c`, all unit tests pass.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3135694

Signature: t1:3135694:1459809348:5b120e527427032857aa976278cca2ef8d3f1372
2016-04-08 22:34:03 -07:00
Tony Tung
cc38718558 [fastmanifest] get_path should not return a node_t
Summary: Callers of `get_path` do not need to know the internal representation of a node.  All they are interested in is the presence, the checksum, and the flags.

Test Plan: passed unit tests

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D3135625

Signature: t1:3135625:1459809298:4bd982091219fa94a1cfcc18238784c9c6e201b8
2016-04-08 22:33:34 -07:00
Tony Tung
deadce5eb8 [fastmanifest fix all the other places where the pointer style is inconsistent
Test Plan: run unit tests.

Reviewers: #sourcecontrol, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3130423

Signature: t1:3130423:1459811638:268cb647facbde3f2cf2d37118bdfe56bce0e637
2016-04-08 22:33:07 -07:00
Tony Tung
88cd00b144 [fastmanifest] remove path
Summary: Support for removing a path from the tree.  Prunes directory nodes so we don't leave empty ones around.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, lcharignon, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3130263

Tasks: 10589043

Signature: t1:3130263:1460140241:8d3f1824990270d693265fa8389dd5a4893c4552
2016-04-08 22:32:37 -07:00
Laurent Charignon
b8efa60b36 arc: add a linter for check-code
Summary:
It was too easy to check in code that was not passing check-code. I
got tired of fixing it so let's add a linter :)

Test Plan:
Test that the linter works as expected and asks the user to provide
the location of run-tests.py if not set.

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3153365
2016-04-08 15:36:32 -07:00
Tony Tung
8f13f7b1b9 remove copytrace directory from setup script
Test Plan: run python setup.py build

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham, quark, mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3157434

Signature: t1:3157434:1460144627:6a748aaaaaa5e0e1d521817649acf0a43d3786f9
2016-04-08 13:17:42 -07:00
Laurent Charignon
71bef9dc56 remove flaky test + fix check code 2016-04-08 12:43:10 -07:00
Laurent Charignon
edd4f20070 fastmanifest:fix test failure 2016-04-08 11:51:28 -07:00
Laurent Charignon
1dde5e0f97 fastmanifest: better debugging output
Summary:
Before this patch the test output wasn't great looking, with this patch
one can easily see if our caching strategy worked

Test Plan: This is only a test change

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3129319

Tasks: 10604335
2016-04-08 11:49:42 -07:00
Laurent Charignon
59bcb8e5c0 fastmanifest: add python to C layer
Summary: This adds the CPythong interface layer for fastmanifest

Test Plan: Compiles

Reviewers: ttung, durham

Differential Revision: https://phabricator.fb.com/D3157095
2016-04-08 11:48:31 -07:00
Laurent Charignon
f630e13113 fastmanifest: add wrapper to instantiate flatmanifest or treemanifest
Summary:
This patch adds a wrapper that allows us to instantiate either flat
or fast manifest when a manifest is read.
This needs a change in core to work. In manifest.manifest in core we are
currently using two abstractions to create manifests: calling manifestdict()
or _newmanifest(). This was a hack added for the developement of treemanifest
and needs to be changed to make things saner.

Test Plan:
I added a new test. I also ran the whole test suite in core with
the extension, all the tests passed except test-treemanifest.t, failing on the
assert in _flatmanifest as expected.
python run-tests.py -j32 -l
   --extra-config-opt=extensions.fastmanifest=/Users/lcharignon/facebook-hg-rpms/fb-hgext/fastmanifest.py

Reviewers: rmcelroy, ttung, durham

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3115446

Tasks: 10589064
2016-04-08 11:46:18 -07:00
Martijn Pieters
ec719be728 logtoprocess: make certain the fork exits
Summary:
Even if there is an exception in the subprocess call, make sure the fork
doesn't propagate that exception back up to mercurial.

Test Plan: Run $HG/tests/run-tests.py test-logtoprocess.t -i

Reviewers: quark, #sourcecontrol, ttung, durham

Reviewed By: ttung, durham

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3139242

Signature: t1:3139242:1459880540:02ca2d80425d8d948059513990f8f2966ff74c6a
2016-04-08 12:40:32 +01:00
Jun Wu
ba96318bbe test-share-reflog-remotebookmark: check dependencies
Summary:
The test requires remotenames and hg-new-workdir. Check them before running
the test.

Test Plan:
Run the test and make sure it is skipped if either of the dependencies is
missing

Reviewers: #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3153904

Tasks: 10749152

Signature: t1:3153904:1460072643:b79eb2d161330ef7a6270711590f24b57b1e768f
2016-04-07 16:53:54 -07:00
Jun Wu
c73f628483 test-perftweaks: fix file permission test case
Summary:
test-perftweaks fails on both legocastle and my laptop:

```
-  total 12
-  drwxrwsr-x. 2 * . (glob)
-  drwxrwsr-x. 3 * .. (glob)
-  -rw-rw-r--. 1 * branchheads-served (glob)
+  total 4
+  drwxrwsr-x 2 quark quark  60 Apr  7 23:15 .
+  drwxrwsr-x 3 quark quark 120 Apr  7 23:15 ..
+  -rw-rw-r-- 1 quark quark   1 Apr  7 23:15 branchheads-served
```

Fix it by making `.` optional. It seems we only care about the `s` bit.

Test Plan: Run `test-perftweaks.t`

Reviewers: #sourcecontrol, rmcelroy, ttung

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.fb.com/D3153798

Tasks: 10749152

Signature: t1:3153798:1460073004:505d3dfee3dfd9475ccf700a1a28cf1baf1d8777
2016-04-07 16:53:18 -07:00
Jun Wu
b87a93aaef smartlog: use ":" for fake node
Summary:
After the graphmod change happened in core, `:` is used in edges. Change `.`
to `:` to make smartlog look consistent with the graphmod change.

Test Plan:
Make sure these look consistent with the latest hg:

  hg sl
  hg sl --config experimental.graphstyle.grandparent=X

Also run unittest:

  ~/hg/tests/run-tests.py -l test-smartlog.t --extra-config-opt=experimental.graphstyle.grandparent="|" --extra-config-opt=experimental.graphstyle.missing="|"

Reviewers: #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.fb.com/D3153133

Tasks: 10749152

Signature: t1:3153133:1460072873:ea28eb909b8cb069a031b8a27c844869b02b22b5
2016-04-07 16:51:00 -07:00
Jun Wu
b603929009 mergedriver: fix test caused by upstream change
Summary:
Upstream change 3ceac0 removes the `labels` parameter from
`mergestate.*resolve` methods. Let's update our tests.

Test Plan: Run `test-mergedriver.t` with the latest hg

Reviewers: simonfar, #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3153698

Tasks: 10749152

Signature: t1:3153698:1460071369:bca8f52c2cf730513385afbdd809747386a57027
2016-04-07 16:23:49 -07:00
Jun Wu
af343f89df fix code that didn't pass test-check-code-hg.t
Summary:
Fix errors reported by test-check-code-hg.t

```
+  logtoprocess.py:45:
+   >         # https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx
+   line too long
   Skipping statprof.py it has no-che?k-code (glob)
+  tests/test-logtoprocess.t:38:
+   > Use head to ensure we wait for all lines to be produced, and sort to avoid
+   trailing whitespace on non-output
+  tests/test-tweakdefaults-blame.t:41:
+   >   $ hg blame -p a
+   trailing whitespace on non-output
+  [1]
```

Test Plan: Run `test-check-code-hg.t` and make sure it pass

Reviewers: #sourcecontrol, rmcelroy, ttung

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.fb.com/D3153195

Tasks: 10749152

Signature: t1:3153195:1460068592:eae6aa682c1f935f7812b72534dd761d898b62a7
2016-04-07 15:52:47 -07:00
Adam Simpkins
6c3719ed46 phabstatus: clean up error handling
Summary:
Don't blindly swallow all exceptions in getdiffstatus().  Previously this was
masking bugs in the code.  Instead, only catch exceptions thrown by the initial
Popen() call.  Also check the the process return code, and report an error if
it exits unsuccessfully.  Fix a return statement that was incorrectly returning
an erorr message instead of replacement strings.

Also fix the code to use subprocess.communicate() instead of only reading from
proc.stdout.  The old behavior could result in a hang if arc tried to print
data on stderr but we weren't reading it.

Test Plan:
Manually tested the error code paths by forcing arc to fail locally on my dev
server.

Reviewers: #sourcecontrol, ttung, lcharignon

Reviewed By: lcharignon

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

Differential Revision: https://phabricator.fb.com/D3146077

Signature: t1:3146077:1459971594:ebab6a0ccb7bea66da1e23dcb88633c48b3e952b
2016-04-06 12:49:43 -07:00
Tony Tung
fceff111a7 [fastmanifest] search children should return an illegal value when it fails
Summary: 0 is actually a legit index, so if someone checks that instead of the node pointer, then we might find the wrong thing.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.fb.com/D3130262

Signature: t1:3130262:1459557188:661eae1363bf603a77e1d17960db0a5f8f33834b
2016-04-06 12:40:32 -07:00