1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-24 01:28:51 +02:00
Commit graph

1791 commits

Author SHA1 Message Date
epriestley
856cbed527 Remove "force chunking" code from Arcanist
Summary: Ref T7149. This was just for testing and is no longer required.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7149

Differential Revision: https://secure.phabricator.com/D12077
2015-03-15 11:31:41 -07:00
epriestley
a01d3c3b1a Make "arc upload" chunk-aware
Summary: Ref T7149. This makes the client try to use the new `file.allocate` API before falling back to the old stuff.

Test Plan: Used `arc upload` to upload files. With chunking forced, uploaded chunked files.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: joshuaspence, epriestley

Maniphest Tasks: T7149

Differential Revision: https://secure.phabricator.com/D12061
2015-03-13 11:30:50 -07:00
Yomi
f51f55a63c Add a space in the translation when a error message is printed.
Summary: Change 'themto' to 'them to'.

Test Plan: Check message printed...

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12057
2015-03-12 15:23:37 -07:00
nevogd
3d871b4214 Add untracked files to commit using prompt
Summary:
Refs D11990. When using `arc diff` with untracked files in the working
copy, add the untracked file(s) to the commit (as they weren't stashed or
ignored). Add the untracked paths to the list of changes in the editor
template, indicating that the files were added to the commit.

This doesn't add a separate prompt to add untracked files as per the
behaviour prior to D11843.

Test Plan:
Ran `arc diff` with only untracked files, answered yes to the 'create
new commit' prompt. Saw the commit-message with the updated changes
including untracked files. Completed the arc template, and got commit
containing uncommitted, unstaged and untracked files.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11995
2015-03-06 04:41:00 -08:00
epriestley
c36b4ceb18 Check for untracked files in order to fire untracked file prompt
Summary: Fixes T7465. I think I just missed this when untangling the old logic.

Test Plan: Ran `arc diff` with //only// untrakced files, saw warning.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7465

Differential Revision: https://secure.phabricator.com/D11990
2015-03-05 14:44:59 -08:00
epriestley
4e98454840 Fix a newline issue in "arc" workflows
Summary:
We end up with one too few newline here in some workflows, like `arc land` with unstaged changes.

Root issue here is that `phutil_console_prompt|confirm` lead with too much whitespace but that's a harder fix.

Test Plan: Saw reasonable whitespace.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11927
2015-03-02 08:34:46 -08:00
epriestley
d8182cf55d Make "arc which --show-base" work as expected
Summary: This is supposed to just print out the base revision, but actually prints out the repository section first.

Test Plan: Ran `arc which`, `arc which --show-base`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11888
2015-02-25 13:09:00 -08:00
epriestley
dd59423d56 Use $EDITOR to prompt users when creating a new commit out of dirty working copy changes
Summary:
Fixes T7344.
Currently, we use `phutil_console_prompt()`, which isn't a very good editor. Use the real $EDITOR instead.

100% of the logic here was also a gigantic mess. Clean it up.

Test Plan: Will update in a second with console output from this run.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7344

Differential Revision: https://secure.phabricator.com/D11843
2015-02-21 02:37:58 -08:00
epriestley
8f8fe44b05 Update arcanist to work with more modular translations
Summary:
Ref T7152. Ref T1139.

  - Tweak API.
  - Move translations out of __init__ file.

Test Plan:
  - Ran `arc`.
  - Added a goofy translation and made sure it was working.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7152, T1139

Differential Revision: https://secure.phabricator.com/D11746
2015-02-11 13:02:11 -08:00
Joshua Spence
3f132f4a4e Fix xsprintf callback
Summary: After all that, I forgot to change this back.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11735
2015-02-11 18:29:12 +11:00
cburroughs
6dadb6b48c losen pep8 version check
Summary:
pep8 has used both 2 (`1.2`) and 3 (`1.2.1`) digit versions.  Losen
the version check to allow for both.

NOTE: This is the same regex as flake8.

Test Plan: `arc unit` with a 2 and 3 digit pep8 version on `$PATH`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: joshuaspence, epriestley

Differential Revision: https://secure.phabricator.com/D11728
2015-02-10 06:17:25 -08:00
Joshua Spence
17ec3859cd Fix pht method calls
Summary: Ref T7046. This is mainly a proof-of-concept for D11661.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7046

Differential Revision: https://secure.phabricator.com/D11683
2015-02-10 18:48:38 +11:00
Joshua Spence
d8ba7e6f71 Add a linter rule to detect mismatched parameters for formatted strings
Summary: Fixes T7046. Adds a linter rule to detect mismatched parameters for formatted strings. Originally I had considered putting this rule in `ArcanistPhutilXHPASTLinter`, but I later decided to move it to `ArcanistXHPASTLinter` as I think that it is general enough to be more widely useful.

Test Plan: This seems to work but needs some polish.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7046

Differential Revision: https://secure.phabricator.com/D11661
2015-02-10 18:43:03 +11:00
Joshua Spence
b32cce79b2 Rename ComprehensiveLintEngine class for consistency
Summary: Ref T5655.

Test Plan: Ran `arc lint` with `lint.engine` set to `ComprehensiveLintEngine` and saw a deprecation notice.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11673
2015-02-10 06:57:43 +11:00
Joshua Spence
3498d6adfc Rename ArcanistCompilerLikeLintRenderer
Summary: Ref T5655. "Compiler-like" seems a bit odd to me.

Test Plan: `arc lint` + `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11670
2015-02-10 06:57:10 +11:00
Joshua Spence
f13b7d73d0 Remove deprecated support for specifying flags as a string
Summary: It should be safe to remove this now.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11714
2015-02-10 06:55:49 +11:00
Joshua Spence
bf7b32fe2c Rename ArcanistXHPASTLintTestSwitchHook class
Summary: Ref T5655.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11712
2015-02-10 06:55:03 +11:00
Joshua Spence
7c9b8237a0 Change a method name
Summary: Ref T5655.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D11713
2015-02-10 06:53:53 +11:00
Joshua Spence
59640f7eae phtize some strings in ArcanistPhutilTestCaseTestCase
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11671
2015-02-05 07:22:00 +11:00
Joshua Spence
992d939e3a Remove the ArcanistArcanistLinterTestCase
Summary: I don't think that this provides too much value. I think that we should rework this to be inferred from the `.arcconfig` file perhaps?

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11662
2015-02-05 07:21:00 +11:00
Bob Trahan
5c20df1818 Arcanist / Conduit - stop using deprecated diffusion.getcommits
Summary: Fixes T7113. This one was a bit trickier than others as the API output changed a bit. In particular, there is no "errors" emitted so much as the result set just doesn't include the answer if things are garbage. Ergo, check the "identifier map" to either check for diff existence or to lookup the phid to grab the actual diff data from the "data" part of the result.

Test Plan: called `arc backout D11665` and got some working output...!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7113

Differential Revision: https://secure.phabricator.com/D11667
2015-02-03 14:33:06 -08:00
Bob Trahan
d98c104991 Arcanist / Conduit - stop using deprecated differential.getdiff API
Summary: Fixes T7112. Nothing too difficult here.

Test Plan:
meta - submitting this with the new arcanist code
used conduit API to verify the difference between getdiff (just the latest diff) and querydiffs (all diffs that match, with the latest diff first in the set)

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7112

Differential Revision: https://secure.phabricator.com/D11665
2015-02-03 14:18:10 -08:00
epriestley
a08383aa1b Make "no working copy" a more explicit "arc" VCS
Summary:
Some commands (like `get-config`) do not require a working copy at all. Recent changes prevented these commands from running outside a VCS working copy.

Let `null` mean "no working copy".

See also <https://github.com/phacility/phabricator/issues/800>.

Test Plan:
  - Ran `arc get-config` from outside a working copy.
  - Ran `arc list` from outside a working copy, got an error.
  - Ran `arc commit` in a Git working copy, got an error.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11643
2015-02-03 12:32:46 -08:00
Joshua Spence
77eb24b13a Only allow arc branch to be used under git
Summary: Explicitly declare that the `arc branch` command is only supported under `git`.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11552
2015-02-04 06:58:53 +11:00
Joshua Spence
0fd04109e9 Indicate relevant VCS for arc feature
Summary: This workflow only works on git + mercurial.

Test Plan: I don't even subversion.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11626
2015-02-04 06:54:08 +11:00
Joshua Spence
6b31c0b98a List supported VCS for arc backout
Summary: This workflow does not work on subversion.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11625
2015-02-04 06:53:58 +11:00
Joshua Spence
7eb86b2371 Mark git-hook-pre-receive as git only
Summary: It doesn't make any sense to run this command on another VCS.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11624
2015-02-04 06:53:47 +11:00
Joshua Spence
6bca7f0146 Mark arc svn-hook-pre-commit for subversion only
Summary: It doesn't make any sense to run this command on any other VCS.

Test Plan: Ran `arc svn-hook-pre-commit` and hit the usage exception.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11623
2015-02-04 06:53:41 +11:00
Joshua Spence
24ab7b7f38 Allow ArcanistPhutilLibraryLinter to run with an out-of-date XHPAST binary
Summary: There is no need to check if the XHPAST binary is available here because this linter does not actually parse PHP, it only considers the library map.

Test Plan: Removed the XHPAST binary and ran `arc lint` on a bunch of files.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11528
2015-02-03 08:01:11 +11:00
Joshua Spence
70f9b5d3ae Use PhutilXHPASTBinary methods
Summary: Use `PhutilXHPASTBinary` methods instead of `xhpast_parse` functions. Depends on D11517.

Test Plan: N/A, this is a direct swap.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11613
2015-02-03 06:58:33 +11:00
Joshua Spence
0ef326f3a5 Use XHPAST version instead of checksum as cache version
Summary: Rely on the output of `xhpast --version` when determing the lint cache key.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11611
2015-02-03 06:56:35 +11:00
Joshua Spence
0584d4a06f phtize strings in ArcanistSettings
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11610
2015-02-03 06:54:46 +11:00
Joshua Spence
e4be031778 Explicitly check for supported VCS
Summary: Instead of having an `ArcanistWorkflow` subclass explicitly throw an exception when run in an unsupported VCS, consolidate this code and move it to `arcanist.php`. In doing so, we lose some specificity in some of the error messages, but this otherwise feels cleaner. We could consider adding a `getUnsupportedRevisionControlSystemMessage()` method to provide a more tailored error message. Depends on D11604.

Test Plan:
Ran `arc bookmark` in a `git` working copy:

```
Usage Exception: `arc bookmark` is only supported under hg.
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11550
2015-02-03 06:54:22 +11:00
Joshua Spence
52277fc06f Modernize ArcanistPhpcsLinter
Summary: Allow `--severity` to be specified using `.arclint`.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11511
2015-02-03 06:43:55 +11:00
Joshua Spence
623df14ae5 Change "any" to explicitly list revision control systems
Summary: Using `array('any')` to represent `array('git', 'hg', 'svn')` is a bit magical and leads to a lot of special-casing.

Test Plan: Verified that tab completion (ala `ArcanistShellCompleteWorkflow`) still worked.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11604
2015-02-02 18:19:29 +11:00
Joshua Spence
8cad12034f Minor tidying of ArcanistPasteWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11566
2015-02-01 21:57:49 +11:00
Joshua Spence
8208cd3231 Minor tidying of ArcanistRevertWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11557
2015-02-01 21:56:28 +11:00
Joshua Spence
589ee20a76 Minor tidying of ArcanistUploadWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11556
2015-02-01 21:54:53 +11:00
Joshua Spence
3e63402fef Minor tidying of ArcanistPhrequentWorkflow classes
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11555
2015-02-01 21:49:53 +11:00
Joshua Spence
62e15dcc15 Minor tidying of ArcanistCallConduitWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11567
2015-02-01 11:05:27 +11:00
Joshua Spence
fcd882815a Minor tidying of ArcanistUpgradeWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11554
2015-02-01 11:01:37 +11:00
Joshua Spence
c76c5d893e Minor tidying of ArcanistVersionWorkflow
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11553
2015-01-30 07:15:05 +11:00
Joshua Spence
e9ffde30ba Fix ArcanistJscsLinter unit tests
Summary: These tests are failing with the latest version of `jscs` (v1.10.0).

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11520
2015-01-28 06:49:02 +11:00
Joshua Spence
edc60cefc4 Fix failing unit tests for ArcanistLesscLinter
Summary: A bunch of unit tests are failing with the latest version of `lessc` (v2.3.0). I decided to delete a bunch of test cases for this linter as we have far too many at the moment.

Test Plan: `arc unit`

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11521
2015-01-28 06:48:50 +11:00
Joshua Spence
d4ed44682d Minor tweak to .arclint file
Summary: Self-explanatory.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11500
2015-01-27 06:58:36 +11:00
Joshua Spence
d0f84e8492 phtize some strings
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11503
2015-01-27 06:58:31 +11:00
Joshua Spence
c450fa6c06 phtize a bunch of strings
Summary: Self-explanatory.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11501
2015-01-27 06:58:19 +11:00
Joshua Spence
1a3afa4429 Add a linter rule to detect call-time pass-by-reference
Summary: Call-time [[http://php.net/manual/en/language.references.pass.php | pass-by-reference]] is an awful "feature" of PHP that is deprecated and removed in PHP 5.4 (see http://us1.php.net/manual/en/migration54.incompatible.php). Add a linter rule to `ArcanistXHPASTLinter` to detect the use of this feature and raise an error.

Test Plan: Added a test case for `arc unit`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10537
2015-01-23 07:56:58 +11:00
Joshua Spence
0b22838cca Allow arc unit --everything to work without a base commit
Summary: Fixes T2461. Similarly to `arc lint --everything`, `arc unit --everything` should work without a base commit.

Test Plan: Removed the `.git/arc/default-relative-commit` file and ran `arc unit --everything`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T2461

Differential Revision: https://secure.phabricator.com/D11459
2015-01-23 07:21:53 +11:00
Joshua Spence
937861ce58 Improve handling of options for arc workflows
Summary: Allow `--severity=warning` to mean the same as `--severity warning`. Longer term, we should convert this code to use `PhutilArgumentParser`, although it doesn't seem that `PhutilArgumentParser` support British spelling ;)

Test Plan: Ran `arc lint --severity=warning`. Also `var_dump`ed `$args` to make sure it looked reasonable.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11464
2015-01-23 07:07:37 +11:00