Commit Graph

244 Commits

Author SHA1 Message Date
Durham Goode
49e649fba6 pushrebase: add pre-lock hook
Summary:
This adds a hook before we take the lock that allows us to run some expensive
hooks without blocking the entire repo. This is useful for hooks that check the
contents of the bundle for certain info (like conflict markers), that won't be
affected by rebases.

Test Plan:
Added a test. Verified it passed when hg had lazy locks enabled for
unbundle, and failed with mercurial did not have lazy locks for unbundle.

Reviewers: pyd, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2511561
2015-10-05 18:56:46 -07:00
qdou
befd0d1a9c typo-fix
changed reseting to resetting in reset.py and test-reset.t

Summary: changed reseting to resetting in reset.py and test-reset.t

Test Plan: checked output and run test to ensure "reseting" is changed to "resetting"

Reviewers: cdelahousse, #sourcecontrol

Subscribers: siqi

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

Tasks: 8581478
2015-10-12 19:53:04 -07:00
Cecile Berillon
50d5a2d718 Moved merge comment to hint
Summary: Moved merge comment to hint in Abort

Test Plan: test output

Reviewers: rmcelroy

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

Tasks: 8593074
2015-10-08 11:32:39 -07:00
Christian Delahousse
70b85f9c12 [morestatus] add helpful message to status when in bisect
Summary:
A continuation D2502125. Add more helpful output to hg status when the user is
in a bisect state.

Example output


  10/07 17:43 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/bisect
  $ hg status

  # The repository is in an unfinished *bisect* state.
  # To mark the commit good:       hg bisect --good
  # To mark the commit bad:        hg bisect --bad
  # To abort:                      hg bisect --reset

Test Plan: Tests have been updated

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: akushner

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

Tasks: 8563305

Signature: t1:2520493:1444288081:5da20016aaaaff77db24ecb01c404b0e11aeeb7a
2015-10-07 17:40:42 -07:00
Christian Delahousse
b5ee3f4aed [morestatus] messages in status for histedit, graft, unshelve, merge states
Summary:
Continuation of D2502125. Let's help people when they're in a wierd states by
displaying a helpful message below the output of `hg status`

Example output:
  10/07 16:53 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/merge
  $ hg status
  M a

  # The repository is in an unfinished *merge* state.
  # Unresolved merge conflicts:
  #
  #     a
  #
  # To mark files as resolved:  hg resolve --mark FILE
  # To continue:                hg commit
  # To abort:                   hg update --clean .

For more example output, see the tests

Test Plan: See tests: `tests/test-morestatus.t`

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: akushner

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

Tasks: 8563305

Signature: t1:2520272:1444287977:b90b747538754ef4f4f0f8fab3e56f3aa288d3e5
2015-10-07 17:03:17 -07:00
Cecile Berillon
89beed4ce9 Disabling rollback in tweakdefaults
Summary: Disabling rollback in tweakdefaults to replace the hook

Test Plan: testing the message

Reviewers: #sourcecontrol, rmcelroy

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

Tasks: 8578898
2015-10-06 16:10:24 -07:00
Christian Delahousse
4b30d6677c [morestatus] more helpful status for rebase
Summary:
If a user gets stuck in a stopped rebase, give some details to the user when
they run `hg status` about how to move forward.

Let's see if we can get some bike shedding done on one command.

Notes on behaviour:
* it there exists any unresolved conflicts, no matter, they'll be shown.
* there is no way to only show what state the user is in (and not the conflicts). You either turn more status on or off.

Example for rebase:

  10/05 19:34 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/rebasestate
  $ hg status
  M a

  # The repository is in an unfinished *rebase* state.
  # Unresolved merge conflicts:
  #
  #     a
  #
  # To mark files as resolved:  hg resolve --mark FILE
  # To continue:                hg rebase --continue
  # To abort:                   hg rebase --abort


Repo in rebase state after the all files have been resolved:

  $ hg status
  M a

  # The repository is in an unfinished *rebase* state.
  # No unresolved merge conflicts
  # To continue:                hg rebase --continue
  # To abort:                   hg rebase --abort

Test Plan: See tests

Reviewers: #sourcecontrol, rmcelroy, durham

Reviewed By: durham

Subscribers: dancol, pyd, akushner

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

Tasks: 8563305

Signature: t1:2502125:1444189728:d6abf28f09bcc0360628497db8d896025967827f
2015-10-01 21:24:43 -07:00
Durham Goode
c093153d86 perftweaks: fix case collision check 2015-10-07 12:29:56 -07:00
Cecile Berillon
0272f0d7ec Disabling merge in tweakdefaults
Summary: Disabling merge in tweakdefaults to replace the hook

Test Plan: enable, disabled, disabled and meaasge modified

Reviewers: #sourcecontrol, rmcelroy

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

Tasks: 8593074
2015-10-06 16:39:18 -07:00
Durham Goode
a92b5a9582 pushrebase: fix tests 2015-10-05 19:20:15 -07:00
Christian Delahousse
cc9035e370 [status] Make status show what state the repo is in
Summary:
This is an MVP to give the user more information about the state of the repo. We'll grow the functionality in other diffs.

 for example, if the repo is in a state after a stalled graft, then hg status outputs a bit more

  $ hg status
   M a
   ? a.orig
   # The repository is in an unfinished graft state.

Test Plan: See the tests.

Reviewers: #sourcecontrol, durham, rmcelroy

Subscribers: akushner, rmcelroy

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

Tasks: 8563305
2015-10-01 20:17:28 -07:00
Cecile Berillon
388e56c896 Adding config to allow disabling the branch command
Summary: Adding config to disable the branch command and still forcing users to pass --new if it's enabled

Test Plan: Testing branch alone, branch when it's disabled and when it's enabled (with the --new options in both cases)

Reviewers: #sourcecontrol, rmcelroy

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

Tasks: 8500803
2015-09-24 13:09:47 -07:00
Christian Delahousse
df27ba12fe Dropped local run-tests in favour of using mercurial's own test runner
Summary:
To do so, we had to change some path variables and change the output of some
tests. Removed a few dependencies that provided by hg.

Test Plan:
Ran the tests. There was some ignorable output changed (about devel-warn) caused by other code not
related to this change.

Reviewers: #sourcecontrol, pyd, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, durham

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

Signature: t1:2499721:1443745230:9d4e53e83356807f3343c8343e28d10f1b9dc35f
2015-10-01 13:03:03 -07:00
Ryan McElroy
5be993a5b8 pushrebase: fix up bad pushkey change
Summary:
Also added an additional test to show a case that fails now (and should fail),
but would have succeeded with the previous code.

Test Plan: Additional unit test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

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

Signature: t1:2502396:1443809922:18ec6697b7c135c37c10f7bdd9544901c4a54c99
2015-10-02 00:46:37 -07:00
Ryan McElroy
ccb4595e9e pushrebase: redo check for bookmark moving forward
Summary:
The old check moved the bookmark old node after the prepushkey hooks
had ran, bypassing the non-ff prevention logic. This moves the old node rewrite
to before the prepushkey hook and also checks that old node is moved in a
ff-only way.

Test Plan: updated unit test

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: durham

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

Signature: t1:2499633:1443733890:4c84150bd0f21adb97feb23e54727bb4e8be38cf
2015-10-01 11:57:06 -07:00
Ryan McElroy
ba64067032 pushrebase: redo check heads elision to be on the client side
Summary:
By removing the part on the pushrebase client instead of ignoring it on the
pushrebase server, the server can still run this check for non-pushrebase
pushes so it will be safer against divergent heads.

Test Plan: Updated unit tests

Reviewers: #sourcecontrol, pyd, durham

Reviewed By: pyd, durham

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

Signature: t1:2499115:1443736440:001ceb79a4692abbd4c6b208124f6576f10f680c
2015-10-01 11:15:37 -07:00
Cecile Berillon
412d5aaec9 Changing tag disabled by default to tag enabled by default
Summary: Changing tag disabled by default to tag enabled by default

Test Plan: tag default policy, tag when disabled with or without default message

Reviewers: rmcelroy

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

Tasks: 8500389
2015-09-28 14:39:56 -07:00
Ryan McElroy
170afe7179 pushrebase: do not fail when old bookmark location does not match
Summary:
In pushrebase, we expect bookmarks to be moving after discovery but
before we grab the lock. With this patch, we rewrite the incoming bookmark
changes so that they do not fail if the bookmark moves after discovery.

Test Plan:
Wrote a new test to cover this behavior and verified that the test failed before
this change but works afterwards.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham

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

Signature: t1:2488675:1443503039:660f88da9727a74f7c9a21f0767efb5d7379d16d
2015-09-28 18:42:18 -07:00
Ryan McElroy
28e4ce1306 pushrebase: turn off check:heads bundlepart during push
Summary:
This check was causing pushes to fail when heads change during a push, but that
is expected in pushrebase pushes.

Test Plan: ran existing tests

Reviewers: ericsumner, #sourcecontrol, durham

Reviewed By: #sourcecontrol, durham

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

Signature: t1:2482254:1443468591:23dc9ad24e1c7d3b3ec04be678d346dfed6d98a7
2015-09-27 15:45:31 -07:00
Durham Goode
4d72067cbd Add option to disable reading from the tag cache
Summary:
The tag cache can be pretty expensive to populate, and in many of our repos we
do not even allow tags, so let's allo disable it entirely.

Test Plan: Added a test

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: #sourcecontrol, rmcelroy

Subscribers: rmcelroy

Differential Revision: https://phabricator.fb.com/D2481606
2015-09-25 13:45:08 -07:00
Cecile Berillon
c521ae86f6 Adding tag tweak
Summary: Adding tag tweak and warning on the tags command

Test Plan:
Testing the tag command if allowed, not allowed with default message and not allowed with custom message
Testing if the default warning message or custom message prints when tags is called

Reviewers: durham, #sourcecontrol, rmcelroy

Reviewed By: #sourcecontrol, rmcelroy

Subscribers: cdelahousse, durham

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

Tasks: 8500389
2015-09-24 11:29:41 -07:00
Durham Goode
e69ea77935 pushrebase: remove transaction spam from tests
Summary:
This tests were A) unreadable, and B) not deterministic. Let's remove all that
text and have a special test just for making sure the hook vars we care about
are present.

Also break the output into multiple lines for easier reading and diffing.

And fix a change in order for the remotenames test.

Test Plan: Ran the tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2479274
2015-09-24 20:03:02 -07:00
Durham Goode
64ed8a8d62 fbamend: fix to use loaded rebase, instead of system rebase
fbamend was using the python system rebase instead of the one loaded by
Mercurial. This broke the tests when the installed rebase differed from the
version of Mercurial we were running the tests with.
2015-09-24 19:46:12 -07:00
Eric Sumner
ae66dcdfae Make pushrebase set HG_NODE when it makes a commit
Test Plan: ran tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2471540
2015-09-23 10:25:24 -07:00
Ryan McElroy
3724810d00 make status relative
Test Plan:
updated test; made sure to include `HGPLAIN`

ran `arc diff` from repo root and from subdir; both worked

In `fbsource/fbobjc` I ran `arc lint` and there were no warnings but it did fail to find `/usr/bin/xcrun` (which is the same behavior as before).
I repeated this in `fbsource/fbobjc/Configurations` to check for path issues; same result.

In `www` I ran `arc lint` and there were no warnings. I repeated this in `www/flib` and got the same result.

Reviewers: durham, #sourcecontrol

Reviewed By: durham, #sourcecontrol

Subscribers: durham, akushner

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

Tasks: 8432204

Signature: t1:2457648:1442622676:611ad3072d11b91feb947c0eb7eb25b621c61eb1
2015-09-18 10:20:49 -07:00
Ryan McElroy
7e8bf80a31 tweakdefaults: fix ordering issue for real
Summary: I thought we had already done this

Test Plan: Used new tweakdefaults and the rebase abort issue was fixed!

Reviewers: #sourcecontrol, durham

Reviewed By: #sourcecontrol, durham

Differential Revision: https://phabricator.fb.com/D2457645
2015-09-18 10:15:59 -07:00
Mat Wood
e209fa0e70 Fixing fb-hgext fbamend test
Summary: The test-fbamend.t test is failing because of some error codes that no longer happen with an unsuccessful 'hg amend' command. The command prints out 'nothing changed' and no longer throws an error.

Test Plan: After the change, I ran the tests and confirmed the test-fbamend.t test is now passing.

Reviewers: cdelahousse, jetzhao, ttung, romanchadnov, matwood, durham, #sourcecontrol

Reviewed By: durham, #sourcecontrol

Subscribers: rmcelroy, pyd, mitrandir

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

Signature: t1:2446352:1442536997:e0d7ec996062f8bba5ee125c51091168750f1472
2015-09-17 17:40:18 -07:00
Mat Wood
83adb89ac4 Fixing smartlog errors on empty repo
Summary: An empty repo will cause the smartlog extension to have errors. SCM is trying to iterate through an empty dataset. Smartlog needs to catch the exception and abort if the current repo is empty.

Test Plan: Added tests to make sure 'hg smartlog' on a newly created repo doesn't explode. Confirmed that tests failed before the fix, and they pass with the fix in place.

Reviewers: cdelahousse, jetzhao, romanchadnov, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, ericsumner

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

Tasks: 8118567

Signature: t1:2446132:1442512709:6a666351a02639f6e0b15c6c7476a8cdd25370c9
2015-09-15 16:13:13 -07:00
Christian Delahousse
bcaf93b996 Added git checkout -f without args to githelp
Summary:
`githelp` supported `git checkout -f xyz` but not the same command with out a
path or a rev. Added support for it and wrote a test.

Test Plan:
Added tests and ran them.

Task: #7499727

Reviewers: ericsumner, durham

Reviewed By: durham

Subscribers: joesavona

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

Signature: t1:2372309:1440530832:cb32553b2ef7f7ff0e09cb80ff6449a8c26c2caf
2015-08-21 16:32:43 -07:00
Christian Delahousse
f90fce8d84 Fixed test-tweakdefaults.t on hg up failure
Summary:
Commit 865f9f0d3df0 modifying the `hg up` command broke the tests. I updated
the test.

Test Plan:
    $ ./run-tests.py test-tweakdefaults.t
    warning: Testing with unexpected mercurial lib: /usr/lib64/python2.6/site-packages/mercurial
            (expected /tmp/hgtests.PK6gU9/install/lib/python/mercurial)
    .
    warning: Tested with unexpected mercurial lib: /usr/lib64/python2.6/site-packages/mercurial
            (expected /tmp/hgtests.PK6gU9/install/lib/python/mercurial)
    # Ran 1 tests, 0 skipped, 0 warned, 0 failed.

Task: #8105963

Reviewers: durham, ericsumner

Reviewed By: ericsumner

Subscribers: thm, joesavona

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

Tasks: 8105963

Signature: t1:2373449:1440439161:44e57904fbd32a4d92cc7ebae94aecde4671542e
2015-08-23 00:08:06 -07:00
Tony Tung
6fdff081b8 fix breakages due to fbconduit api changes regarding missing revs
Summary:
FBConduit used to throw a conduit error when a rev didn't map.
Now, it just returns an empty string for the mapping.  This updates the
fbconduit extension so that it matches the server behavior.

Test Plan: passed unit tests.

Reviewers: mitrandir, ericsumner, durham

Reviewed By: ericsumner

Subscribers: mitrandir

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

Tasks: 7970302

Signature: t1:2331464:1439500203:cbf79e9b9c54aebdf33bbad82c1982b5a69e8bc9
2015-08-10 21:22:21 -07:00
Ryan McElroy
273f9d02a8 Make smartlog's 'important' bookmarks configurable
Summary:
Different repos have different notions of important bookmarks. Allow
configuring it.

Test Plan: added a new test

Reviewers: #sourcecontrol, durham

Reviewed By: #sourcecontrol, durham

Subscribers: durham

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

Tasks: 7955325
2015-08-12 14:58:41 -07:00
Durham Goode
07da1f3e15 pushrebase: fix rebasing merge commits
Summary:
It turns out commit.files() does not return all the affected files during a
merge commit. It only returns files which differ from both p1 and p2, so in a
merge commit where we accept the changes from p2, the changes were lost during
the rebase.

This fixes it by performing a manifest diff if we're grafting a merge commit.

Test Plan:
Updated the tests to check the file contents (this test would fail
before)

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2331586
2015-08-10 22:15:03 -07:00
Josh Braegger
5576d9be8d githelp: Add 'deprecated' message for 'git whatchanged'
Summary: Just in case someone trys to use 'git whatchanged', at least tell them why it's not supported

Test Plan: added a test

Reviewers: rmcelroy

Reviewed By: rmcelroy

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

Tasks: 7966012

Signature: t1:2329289:1439242809:56fb56704e1110dc95a6366ee9c3eb948e1bf415
2015-08-10 14:00:23 -07:00
Laurent Charignon
d3debca37b inhibitwarn: fix broken test 2015-08-06 11:20:20 -07:00
Durham Goode
6347babe11 fbhistedit: add execr action
Summary:
Adds an xr/execr action that executes the command relative to the
current working directory. This allows our users to run 'arc diff' and pick up
whatever the current arc project is (instead of whatever arc project is at the
root of the repository).

Test Plan: Added a test

Reviewers: davidsp, #sourcecontrol, lcharignon

Reviewed By: #sourcecontrol, lcharignon

Subscribers: rmcelroy, lcharignon

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

Tasks: 7795286
2015-08-04 10:55:33 -07:00
Durham Goode
32627292e9 fbhistedit: reapply the backed out change
Now that we've rolled out new rpms everywhere, we can redo this change.
2015-08-04 23:10:59 -07:00
Durham Goode
dc196e2b2d fbhistedit: backout 192e9fd62d3c since the tests aren't passing 2015-08-04 10:08:04 -07:00
Durham Goode
48f7f4f934 pushrebase: don't do rebase if -f is specified
Summary:
pushrebase doesn't support pushing non-fastward heads when remotenames is on
(since --to implies both remotenames and do a rebase). Long term we want --new
and --replace to indicate bookmark movements, but for now we can use the
existing -f to imply that we don't want a rebase to happen.

Test Plan: Added a test

Reviewers: #sourcecontrol, lcharignon

Reviewed By: #sourcecontrol, lcharignon

Subscribers: lcharignon

Differential Revision: https://phabricator.fb.com/D2307585
2015-08-03 15:33:00 -07:00
Durham Goode
17b48c71b2 fbhistedit: add more test cases for histedit
Summary:
This is testing more failing case involving command creating obsmarkers during interruption.

More corner case testing could be added, but this is a good start.

Test Plan: test crash before update of core. Properly pass with the series current in review on mercurial-devel

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2307305
2015-07-31 15:53:16 -07:00
Pierre-Yves David
2a3ff656d9 fbhistedit: adapt test to backout of 3e883e7ec57b
There is some stripping involved again. We update the test to reflect this.
2015-08-03 14:50:09 -07:00
Pierre-Yves David
397a9f095d b2xcompat: remove the extension
Summary:
This extension was a temporary hack to help people move from the experimental
bundle2 format to the final one. All user have been moved so we can put this
very hacky extension to the sword.

Test Plan: ran setup.py install --prefix /tmp/foobar, b2xcompat was no longer there.

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2298571
2015-07-30 13:10:23 -07:00
Laurent Charignon
1ed49d16a1 inhbitwarn: change date format to ISO8601
Summary: We decided to do that in https://phabricator.fb.com/D2294809

Test Plan: Added a test

Reviewers: durham, rmcelroy, pyd

Differential Revision: https://phabricator.fb.com/D2296276
2015-07-30 10:29:36 -07:00
Gregory Szorc
4d32cb4009 pushrebase: don't use evolve in tests
Evolve isn't a part of core Mercurial nor is it part of this repository.
Make it easier to run tests for pushrebase by removing the evolve
dependency.

This does drop a workflow test that `hg evolve` after a rebased push
does the right thing. But, evolve's behavior in the presence of
specific obsolescence markers should be pretty well tested and it
shouldn't be strictly necessary to test this behavior.
2015-06-12 16:34:35 -07:00
Laurent Charignon
d051374662 pushrebase: update test to remove mistake 2015-07-30 11:14:14 -07:00
Laurent Charignon
7e55f2106e pushrebase: remove tail check
Summary:
The tail check was flagging by mistake scenarios where the push was
possible. This patch adds one of these scenario.

Test Plan: Add new test and all former tests are passing

Reviewers: ericsumner, durham

Differential Revision: https://phabricator.fb.com/D2292866
2015-07-29 13:32:51 -07:00
Laurent Charignon
4a7d8e9f70 pushrebase: fix fastfoward case
Summary:
Before this patch, pushrebase was not supporting some cases of fast
forward push. This patch fixes the issue.

Test Plan:
Added a new test. Check that the test failed before and is fixed
with the code change.

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D2279800
2015-07-24 15:23:16 -07:00
Durham Goode
8fbe1e4ea1 sparse: make sparse extension work on non-sparse repos
Summary:
It's possible that the sparse extension might be loaded, even if the sparse
extension is not enabled for the particular repo (like if you're cloning from a
sparse repo to a non-sparse repo on the same machine). Previously it broke,
because we assumed all repo's had sparsematch(). Now we check for it before
using it.

Test Plan:
Added a test. The old test wasn't sufficient since it didn't have any
commits, so the dirstate was not interacted with

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2278657
2015-07-24 13:03:09 -07:00
Laurent Charignon
66fabe5549 pushrebase: update tests for new version of hg 2015-07-24 16:05:56 -07:00
Laurent Charignon
d2bc198c5e pushrebase: record copies, exec and link properly
Summary:
Before this patch we were not recording all the information for file
copy, executable bit and link. This patch fixes the issue.

Test Plan: Add a new test with a copy

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D2277575
2015-07-24 09:38:01 -07:00
Laurent Charignon
8f43bce88c pushrebase: fix bug for changesets that remove file
Summary:
I saw this error when using pushrebase with fbsource on a commit
that deleted a file. We were trying to access it even if it was not in the
manifest.

Test Plan:
Modified the test
Before the code fix the new test fails with:
    remote: abort: b@46a2df24e272: not found in manifest!

Reviewers: durham, ericsumner, pyd

Differential Revision: https://phabricator.fb.com/D2274792
2015-07-23 14:11:58 -07:00
Durham Goode
27729358a1 Fix pushvars with remotenames
Summary:
The old order fix was not quite right, since it modified a local copy of _order
instead of the extension modules copy.

Test Plan:
Added a test that verifies the hooks can see a pushvar even through
remotenames

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2275767
2015-07-17 15:47:30 -07:00
Durham Goode
d7d95c9b9c update fbhistedit and tweakdefaults tests to match new upstream hg 2015-07-22 15:58:02 -07:00
Durham Goode
b804c11020 smartlog: hide public heads when remote bookmarks are enabled
Summary:
If the user is using remote bookmarks, let's hide the public heads from the
smartlog output. This allows the server to do a non-fastward bookmark move,
without having the old heads cluttering the user's smartlog output.

Test Plan: Added a test

Reviewers: mitrandir, rmcelroy, ericsumner, lcharignon

Reviewed By: lcharignon

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

Signature: t1:2264878:1437505970:664348ed91ba8d8b1018299e282ed4308bfbdbc0
2015-07-21 11:32:27 -07:00
Tony Tung
858f3babb5 changed the port the unit test runs on.
Summary: as per @ericsumner's comment, changed the port from 8000.

Test Plan: passed unit test

Reviewers: ericsumner, durham, rmcelroy

Subscribers: mitrandir, ericsumner

Differential Revision: https://phabricator.fb.com/D2247429
2015-07-15 14:50:46 -07:00
Tony Tung
db22778620 support for multiple backing repos.
Summary:
# added a backingrepo list configuration variable that enumerates the backing repos.
# wrote a bunch of unit tests to cover this functionality.

Test Plan: passed unit tests.

Reviewers: rmcelroy, durham, ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2247419
2015-07-15 14:48:57 -07:00
Durham Goode
2bc2c1723e merge divergent heads 2015-07-16 11:10:46 -07:00
Tony Tung
eb5fb6bbe3 test more fbconduit functionality.
Summary: Test mirrornode and gitnode as a rev selector.

Test Plan: passed unit tests.  D2246978 is required for these tests to pass.

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

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

Signature: t1:2246986:1436993629:3098c741aabaeeccb81e4e9c03c36c6435c3ccf0
2015-07-15 13:45:27 -07:00
Tony Tung
fdef1590a4 simple fbconduit test
Summary: Exercises the existing fbconduit functionality in a unit test.

Test Plan: it runs!

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

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

Signature: t1:2244924:1436983026:d743d67c90138f4b6f4eeddc96abf5f89f4d0287
2015-07-14 23:04:43 -07:00
Tony Tung
1e6d65e9dc mock fbconduit server
Summary:
Built a http server that serves as a mock fbconduit server.  It
answers the normal requests that fbconduit makes, as well as:

PUT /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash
DELETE /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash

Test Plan: used in later diffs

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

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

Signature: t1:2244917:1436982657:bde0c04ea21299970dfb782b43ed13ab1f3e17b0
2015-07-14 21:20:31 -07:00
Durham Goode
fec612dcb4 pushrebase: support creating new bookmarks
Summary:
Previously pushrebase could not create new bookmarks, because the rebase target
did not exist. This fixes that.

Also fixes some output text to match the core Mercurial behavior, so tools can
rely on the text in certain cases.

Test Plan: Added a test

Reviewers: lcharignon, pyd, rmcelroy, ericsumner

Reviewed By: ericsumner

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

Signature: t1:2240418:1436895571:2f56298969e09490f6f5e6a44857eedc2bfcace4
2015-07-13 22:01:02 -07:00
Durham Goode
b85c9c6a07 reset: fix resetting past remote bookmarks
Summary:
Previously reseting from above a remote bookmark to below it would delete the
commit that the remote bookmark pointed to. This fixes that and adds a test.

Test Plan: Added a test

Reviewers: rmcelroy, ericsumner, lcharignon

Differential Revision: https://phabricator.fb.com/D2233971
2015-07-10 11:40:30 -07:00
Durham Goode
1ac1afe786 pushrebase: support remotenames 2015-07-13 13:44:56 -07:00
Durham Goode
4d68369f95 Fix pushrebase tests 2015-07-08 21:08:26 -07:00
Ryan McElroy
54c9d29495 fix some failing tests 2015-07-06 19:17:17 -07:00
Ryan McElroy
6eede86d5d tweakdefaults: stop accidental branch command usage
Summary:
In the vast majority of cases, our workflows should not use branches.
Let's make sure people know what they're doing when they create a branch by
failing by default.

Test Plan: added a new test

Reviewers: durham, #sourcecontrol

Reviewed By: durham, #sourcecontrol

Subscribers: durham

Differential Revision: https://phabricator.fb.com/D2213677
2015-07-02 11:11:56 -07:00
Nivedita Chopra
17971958a7 Githelp for 'git checkout -p'
Summary: Implemented hg githelp for 'git checkout -p'

Test Plan:
```
% hg --config extensions.githelp=~/fb-hgext/githelp.py githelp -- git checkout -p xyz
hg revert -i xyz

% hg --config extensions.githelp=~/fb-hgext/githelp.py githelp -- git checkout --patch xyz
hg revert -i xyz
```

Reviewers: akushner, durham

Reviewed By: durham

Subscribers: kowshik

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

Tasks: 6562030

Signature: t1:2209388:1435801909:64db532cd3eeeea05f17c43988958f3fa0dcaae2
2015-07-01 11:38:40 -07:00
Durham Goode
66ee36a750 pushrebase: integrate with remotenames
Summary:
This makes the pushrebase extension work with the remotenames extension. It does
a few things:

1) rename --onto to be --to for consistency
2) configures remotenames to allow non-fastforward pushes
3) changes the push wrapper to happen after remotenames is loaded

Test Plan: Added a test

Reviewers: pyd, rmcelroy, lcharignon, ericsumner

Reviewed By: ericsumner

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

Signature: t1:2200222:1435695629:a92d8b20d158aa40bad1f3963af0348b6680d52d
2015-06-26 11:05:46 -07:00
Durham Goode
be9b0f0deb pushrebase: add support for rebasing merge commits
Summary:
This adds the ability to rebase changegroups that contain merge commits. It
works by identifying the maximum bundle root that is an ancestor of the desired
`onto` and rebases only things that are on top of that root.

Test Plan: Added a test

Reviewers: lcharignon, pyd, ericsumner

Reviewed By: ericsumner

Subscribers: rmcelroy

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

Signature: t1:2194350:1435695516:3a1f62bda7de0da9536a538da0bbb6deceb192f6
2015-06-25 18:49:48 -07:00
Mateusz Kwapich
a64b0e6080 pushrebase: change test to disable bundle2 where needed 2015-06-22 10:36:22 -07:00
Mateusz Kwapich
de1e111aba change ordering of lines in test for pushrebase
'cause threading
2015-06-20 14:27:30 -07:00
Nat Mote
811418bec7 Keep the githelp tests independent
Summary:
I realized that a test I wrote affects the tests later in the test suite because
it cd's into a directory and does not cd out. This fixes that.

Depends on D2171752

Test Plan: run tests

Reviewers: durham, rmcelroy

Reviewed By: rmcelroy

Subscribers: pawelbara

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

Signature: t1:2172941:1434735023:70a829cf4eede8e5aa909d10995bfd5d823b9cb6
2015-06-19 09:21:29 -07:00
Pawel Bara
64c081b92c githelp show: better handling of path arguments
Summary:
'git show' now corresponds to 'git diff -r .^' for paths.
For everything else it still resolves to 'git export'.

Test Plan: take a look at the unit tests.

Reviewers: marcelo, durham, rmcelroy

Reviewed By: rmcelroy

Subscribers: nmote, durham, rmcelroy, owenc

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

Tasks: 6860395

Signature: t1:2171752:1434682344:cf1af959e0da788efa0a526459ee64590b09a00e
2015-06-18 18:04:42 -07:00
Yibo Cai
95f4827866 Update mercurial githelp extenstion to support --shwo-status option
Test Plan: Unit test

Reviewers: owenc, marcelo

Reviewed By: marcelo

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

Tasks: 6860308

Signature: t1:2169664:1434664955:139b9020b3102a7385e1954efeb0afc48b766487
2015-06-18 11:58:59 -07:00
Laurent Charignon
9ae26181cd githelp: revspec ending in "~" in git becomes "~1" in mercurial
Summary:
Before this patch: hg githelp -- reset HEAD~ returned hg reset .~ which was
wrong. With this patch it retuns hg reset .~1.

Test Plan: added a test

Reviewers: mitrandir, durham

Subscribers: scottf

Differential Revision: https://phabricator.fb.com/D2166551
2015-06-17 16:11:03 -07:00
Laurent Charignon
66eee49d7c reset: use scmutil.revsingle instead of reading rev number as is
Summary:
Reset didn't use scmutil to parse revision number given on the command line.
Inhibits plugs in the scmutil logic to enable direct access and therefore reset
was not benefiting from it. This caused the revive logic in reset to create
a new commit instead of reusing the old one.

Test Plan: Added test

Reviewers: durham, pyd

Reviewed By: pyd

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

Tasks: 6696106

Signature: t1:2032910:1430339529:47e2c7d7c2ea76e4ab1114e7215e8517ee9f4356
2015-06-17 14:38:03 -07:00
Durham Goode
86f7770eb5 reset: fix test globbing 2015-06-17 13:10:22 -07:00
Durham Goode
5b01596008 sparse: move hgwatchman integration test to test-sparse-extensions.t
We now have a test file explicitly for extension integrations. So let's move the
hgwatchman test.  Includes some minor changes to make it work.
2015-06-15 17:44:39 -07:00
Durham Goode
59fcb5efbe sparse: add caching around sparse profile reading
Summary:
Previously we would have to decompress the entire manifest to check if each
sparse profile existed. This slowed hg status down by 500ms (2x).

This patch adds caching when simplecache is enabled.

Test Plan:
Added a test.  Also tried it in fbsource. Verified repeated hg
status's did not parse the manifest

Reviewers: rmcelroy, ericsumner, lcharignon, akushner, mitrandir

Differential Revision: https://phabricator.fb.com/D2158178
2015-06-15 17:20:53 -07:00
Durham Goode
1b3926c13d simplecache: move memcache prefix to mcget/set
Summary:
1) moves the memcache prefix part of the key into mcget and mcset, so callers
don't have to care about it.
2) added a stringserializer for storing simple strings
3) removes _ from _memoize so it can be used by other extensions
4) moves key version into memoize function

Test Plan: Ran the tests

Reviewers: rmcelroy, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2158102
2015-06-15 17:19:08 -07:00
Durham Goode
8dbd058742 simplecache: add local caching
Summary:
Having a simple on disk cache is useful in some cases, like when it can prevent
us from having to read a full manifest. Let's add local caching support to
simplecache.

Test Plan:
Added a test

Perf numbers for a basic export
no cache=0.7s
local only=0.46s
memcache only=0.48s
memcache+local=0.48s
local+memcache=0.46s

Reviewers: ericsumner, lcharignon, sid0, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:2149605:1434139712:c8a524ece9bdd91dca122e1305e81aa02912a8d9
2015-06-11 15:29:43 -07:00
Durham Goode
fa50ce426e sparse: change missing profile warning to be debug
Missing profiles are more common than previously expected (for instance when
reading old commits for a rebase).  Let's move this warning to debug.
2015-06-11 14:39:40 -07:00
Durham Goode
b34a9af1d5 Fix repo's where sparse is present but not enabled
Summary:
There can be situations where the sparse extension has run uisetup, but the repo
object doesn't have sparse enabled so it doesn't run reposetup. We need to make
sure all the work uisetup does can condition on whether reposetup has done it's
work or not.

Test Plan: Added a test

Reviewers: lcharignon, pyd, ericsumner, sid0, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:2129966:1433522840:90029011ac8bbb2e1efbaf9fb317c1e55aa18737
2015-06-04 16:50:18 -07:00
Durham Goode
483fff949e Fix reset invalidating the entire dirstate
Summary:
Previously, if you did 'hg reset .' it would invalidate the entire dirstate,
making every entry 'lookup' so it had to read the entire working copy on the
next run. This fixes that.

Technically this is a bug in core mercurial since rebuilddirstate() should
invalidate anything if an empty list is passed.

Test Plan: Added a test

Reviewers: pyd, lcharignon, sid0, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:2129095:1433520638:e05ee86dedcc9f87d5c3fd65e3e2374ecbac5dfb
2015-06-04 15:27:46 -07:00
Durham Goode
2608f65165 Update to match upstream
Upstream has changed there api's slightly. Let's update to match them.
2015-05-27 17:37:19 -07:00
Laurent Charignon
8eb2003bbd fbamend: use strip.strip instead of repair.strip
Summary:
fbamend: use strip.strip instead of repair.strip
This allows fbamend to work better with evolve as evolve overrides the command
strip.strip to prune.

Test Plan: Changed test and ran it.

Reviewers: durham, pyd

Differential Revision: https://phabricator.fb.com/D2082137
2015-05-18 16:28:40 -07:00
Durham Goode
72e331f593 sparse: fix temporary includes that are not in working copy
Summary:
There was a bug where rebasing a commit that contained a file that was not
currently in the working copy would cause an exception. This is because the
'temporarily include a file' logic tries to bring the file back to life
immediately, regardless of if the file actually exists yet or not (it may be an
incoming file from the upcoming merge, so it doesn't exist yet).

Test Plan: Added a test

Reviewers: sid0, rmcelroy, pyd, lcharignon

Reviewed By: lcharignon

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

Signature: t1:2083802:1432075849:7a90c94a97322ca619d481477fcc8812e7a26e93
2015-05-19 10:18:50 -07:00
Durham Goode
ddcf826f81 smartlog: fix masterrev supporting funky bookmark names
Summary:
The master revset config was not using scmutil.revrange/revsingle so it wasn't
able to handle bookmark names like 'foo-bar'. Let's use them.

Test Plan: Added a test

Reviewers: rmcelroy, sid0, lcharignon, ericsumner

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

Tasks: 7116971
2015-05-18 17:36:21 -07:00
Aaron Kushner
215c96605c Add extension to push shell variables to server side hg
Summary:
Create an extension that allows shell variables to be passed to the
server via command line option. When pushing with the following command:

 hg push --pushvars "DEBUG=1"

will make HG_SCM_DEBUG=1 available to the hooks. Note the prepending of HG_SCM_

Test Plan: Run run_tests

Reviewers: pyd, rmcelroy, durham

Reviewed By: durham

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

Tasks: 4841351

Signature: t1:1991994:1430417209:9a05fb11f9ecdeab3a1d89cf331014dafe7d959f
2015-04-14 16:43:51 -04:00
Durham Goode
e6b221f9d6 extras: add commitextras extension
Summary:
This adds an extension which will allow a user to specify commit 'extras' from
the command line. This will allow our repo sync script to include extra metadata
in the commits.

For instance, this is required in order to not lose git's committer info when
syncing into mercurial (which is required in order to make sure two commits with
the same content but different committers will produce a different hash in
Mercurial).

Test Plan: Added a simple test

Reviewers: pyd, lcharignon, mpm, sid0, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:2027341:1430255572:6866d0ba5564ca977c8fce41e55988883e15ce5b
2015-04-27 20:20:48 -07:00
Durham Goode
6b99e31175 fbamend: move evolve warning to be inside the amend command
Summary:
With the new evolve+inhibit ecosystem, we want to allow amend and amend --rebase
to continue working even when evolve is on. Let's move the evolve check to be
inside the amend command, and only complain when we see the evolve commands
enabled.

Test Plan: Added a test

Reviewers: lcharignon, pyd

Reviewed By: pyd

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

Signature: t1:2033649:1430346833:3116b704e49f634709a6fea32e217b94e731b96f
2015-04-07 13:52:59 -07:00
Durham Goode
be069ac108 smartlog: switch to using scmutil.revrange
Summary:
The smartlog rev option wasn't resolving names right because it used
the wrong internal api. Fixes that.

Test Plan: Adds a test

Reviewers: lcharignon, pyd

Reviewed By: pyd

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

Signature: t1:2033646:1430346864:be69cfb5fe3892f51340546b1fbb341fabfffe14
2015-04-29 15:00:31 -07:00
Ryan McElroy
099010405c sparse: alphabetize sparse config for test stability
Test Plan: Updated tests, ran tests many times with no more failures

Reviewers: ttung, durham, mitrandir, #sourcecontrol

Reviewed By: durham, mitrandir, #sourcecontrol

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

Signature: t1:2003040:1430327993:b5b439becb928f45a7594fb727b1335f95f992d0
2015-04-17 14:32:04 -07:00
Ryan McElroy
949908801c sparse: introduce flag on 'hg add' to update sparse config
Summary:
We want to be able to more seamlessly update sparse profiles when adding files.
This patch adds a `--sparse` flag to `hg add` that ensures the directory of the
added file is included in the sparse profile.

Test Plan: updated test

Reviewers: ttung, durham, #sourcecontrol

Reviewed By: durham, #sourcecontrol

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

Tasks: 6733090

Signature: t1:2003039:1430327770:295f1ac9960ca9dcb4ce84f76458faad68106272
2015-04-17 14:29:23 -07:00
Durham Goode
be7516e6bc sparse: integrate with hgwatchman's ignore hash
Summary:
hgwatchman keeps a hash of the ignore matcher. Since we wrap the ignore
matcher to simulate a sparse checkout, we need to provide a hash that changes
as well.

Test Plan:
Adds a test. Verified the test failed without the change, and passed
with it.

Reviewers: rmcelroy, lcharignon, ericsumner, sid0

Reviewed By: sid0

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

Signature: t1:2022219:1429912457:51bf4677e1894ecca6da47a9fa6c4110f132c937
2015-04-24 12:29:31 -07:00
Durham Goode
5cd2a69ed5 Fix status on files in included subdirs
Summary:
There was a bug where if you included 'dir1/dir2/' in your sparse checkout, then
status would not show newly added files in that directory. The problem is that
dir1 is considered ignored, so the status walker would not walk down dir1.

The fix is to explicitly match subdirectories of specified include patterns.

Test Plan: Added a test

Reviewers: pyd, rmcelroy, lcharignon, sid0

Reviewed By: sid0

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

Tasks: 6773875

Signature: t1:2021037:1429899282:3e305afa9ed395473dbe11d80abc43becb9eaa4a
2015-04-24 09:52:00 -07:00
Durham Goode
3bc673a16b reset: fix resetting to bookmarks with odd names
Summary:
Previously, reseting to bookmarks with '-' in the name did not work. We need to
use scmutil.revrange instead of repo.revs to make this happen correctly.

Test Plan: Added a test

Reviewers: ericsumner, rmcelroy, pyd, lcharignon, sid0

Reviewed By: sid0

Subscribers: dreiss

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

Signature: t1:2021737:1429906581:c8deaf61920fad5fd9c9faea16b867685d3be7ad
2015-04-24 13:10:58 -07:00
Durham Goode
3f90727e16 pushrebase: fix pushrebase to match upstream
Summary:
Upstream has removed all the b2x flags, so let's do the same to pushrebase. Also
fixes pushrebase's use of manifest._intersectfiles() which has been removed
upstream (in favor of a matcher).

The tests had a bunch of hardcoded hooks which were very messy and became
impossible to maintain when upstream changed what args were passed. Let's just
get rid of all that noise.

Test Plan: Ran the tests

Reviewers: sid0, rmcelroy, lcharignon, ericsumner, pyd

Reviewed By: pyd

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

Signature: t1:2003033:1429832524:c0de8ebea7e6348ba9b55c109ca71bb3a301b625
2015-04-17 13:49:35 -07:00
Nat Mote
49854411f8 Githelp grep improvements
Summary:
Since hg grep and git grep are similar for basic usage (pattern first and then
paths), just copy all the git arguments to the suggested hg command.

Test Plan: Test added to test-githelp.t

Reviewers: rmcelroy, durham

Reviewed By: durham

Subscribers: elenapr

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

Tasks: 6524222

Signature: t1:2009460:1429647852:2bfaf32b8c7849e948e5da03989fad32c1b06780
2015-04-21 10:21:17 -07:00
Durham Goode
ce52c33e1e writecg2: update to match upstream
Summary:
Upstream has finalized bundle2 and removed the experimental flags. So let's
upgrade along with it.

Test Plan: Ran the tests

Reviewers: sid0, rmcelroy, lcharignon, pyd, ericsumner

Differential Revision: https://phabricator.fb.com/D2003046
2015-04-17 14:30:35 -07:00