1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-19 16:38:51 +02:00
Commit graph

2169 commits

Author SHA1 Message Date
Josh Cox
224986af63 Provide a better error message when an invalid ID is given to arc patch
Summary:
Fixes T8937. Previously when running `arc patch D9999999999` or `arc export --revision 99999999` with a non-existent diff or revision ID you would get a rather unhelpful error message. Now you'll get a slightly more helpful error message:
```
$ arc patch D99999999
Exception
Couldn't find a revision or diff that matches the given ID
(Run with `--trace` for a full exception trace.)
```

Test Plan: Ran arc patch with a valid revision and saw it patch successfully. Ran again with an invalid revision, saw the error message.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T8937

Differential Revision: https://secure.phabricator.com/D17325
2017-02-08 04:53:41 -05:00
epriestley
9503b941cc (stable) Promote 2017 Week 1 2017-01-06 17:01:33 -08:00
epriestley
ade25facfd Fix a bad interaction between "arc diff --reviewers" and "the first line of a message is always a title"
Summary:
Fixes T12069. We implement "arc diff --reviewers" (and "--cc") by parsing a faux message with "Reviewers: ...".

After D17122, the first line of the message is always interpreted as a title, so the text ends up in the message body.

Instead, use a placeholder title so these fields are never initial fields.

Test Plan: Ran `arc diff --reviewers dog`, got only one "Reviewers" field.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12069

Differential Revision: https://secure.phabricator.com/D17147
2017-01-05 14:35:39 -08:00
epriestley
e8b580d2e5 (stable) Promote 2016 Week 53 2016-12-30 14:49:40 -08:00
Chris Burroughs
c243cbbd9f tighten remote URI error handling with idiosyncratic remote names
Summary:
`git ls-remote` has an unusual way to indicate a URL was not
found: echoing back user input
```
$ git ls-remote --get-url does_not_exist
does_not_exist
$ echo $?
0

```

`getRemoteURI` handles checking for remotes other than 'origin', but
the error handling always matched against the string 'origin'
regardless of remote name.

Test Plan:
With a git config along the lines of:
```
[remote "my_special_name"]
        url = ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git
        fetch = +refs/heads/*:refs/remotes/my_special_name/*
[branch "master"]
        remote = github
        merge = refs/heads/master
[remote "github"]
         # url = git@github.com:phacility/arcanist.git
         fetch = +refs/heads/*:refs/remotes/github/*
```

and running in a branch tracking `master` (github).  `arc which` would
(without this diff) show:
```
The remote URI for this working copy is "github".
```
With this diff, `arc which` correctly shows:
```
Unable to determine the remote URI for this repository.
```

When diffing against a tracking branch with a propertly configured
remote (the happy path), `arc which` still correctly identifies the
remote URI:
```
The remote URI for this working copy is
"ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git".
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, chad, epriestley

Differential Revision: https://secure.phabricator.com/D17110
2016-12-29 10:35:59 -05:00
epriestley
e17fe43ca3 (stable) Promote 2016 Week 43 2016-10-21 16:10:48 -07:00
epriestley
fad8584431 Make "aliases" show up in "arc get-config" help
Summary: Fixes T11758. This was one some spooky magic but is more-or-less a normal config setting now.

Test Plan:
  - Ran `arc get-config`, saw help about "aliases".
  - Ran `arc set-config aliases`, saw guidance about using `arc alias`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11758

Differential Revision: https://secure.phabricator.com/D16745
2016-10-21 16:08:45 -07:00
Mukunda Modell
2962504855 Fix an DOMDocument error with NoseTestEngine running on PHP 7
Summary:
In php 7, DOMDocument::loadXML emits an error when supplied with
an empty string as input. For example, I got this error:

  ERROR 2: DOMDocument::loadXML(): Empty string supplied as input

This change simply checks for empty and returns an empty array
rather than attempting to parse an empty xml document.

Test Plan: ran `arc diff` on a repo that uses nosetestengine

Reviewers: #blessed_reviewers!

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D16672
2016-10-09 16:28:51 -05:00
epriestley
71132dbee0 (stable) Promote 2016 Week 41 2016-10-09 06:30:50 -07:00
epriestley
2ad15c499a Don't compute intraline diffs if the input fails a coarse check for being huge
Summary:
Fixes T11744. Because intraline diffs are expensive to generate, we already bail out and decline to generate them for very long lines.

However, we currently split the inputs into lists of characters first, then check how long they are and make a decision to bail. For //huge// inputs (e.g., 1MB+), this is too late: just splitting them has a large CPU/RAM cost.

(These inputs are rare in normal source, but can appear in, e.g., JSON files written without newlines.)

Instead, add an extra "are the inputs really huge?" check first, and bail early if they are.

Test Plan:
  - Generated a 1MB "change a file full of Q to a file full of R" diff.
  - Before change: purged changeset cache; took about 7 seconds to load.
  - After change: purged changeset cache; took about 1 second to load.
  - Viewed some normal diffs to make sure intraline edits still displayed correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11744

Differential Revision: https://secure.phabricator.com/D16683
2016-10-07 07:42:19 -07:00
epriestley
e7906e47cb (stable) Promote 2016 Week 39 2016-09-23 17:20:29 -07:00
Alex Vandiver
483e985d08 Check both UNIX- and Windows-style paths from linter output
Summary:
Paths are passed into linters using UNIX-style slashes (/), as returned from the version control system; however,
`Filesystem::readablePath` swaps them to Windows-style (\) on
Windows when storing the names of the files with lint messages.  This causes no lint message's path to match the set of
changed files, and thus no lint warnings are ever produced.

If a lint message's file is not found using the provided filename, also try looking up the UNIX-style filename, on Windows when determining if a lint mesage is "relevant."

Fixes T11248.

Test Plan: Ran `arc lint` on Windows.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Maniphest Tasks: T11248

Differential Revision: https://secure.phabricator.com/D16579
2016-09-21 14:29:42 -07:00
epriestley
10e5194752 (stable) Promote 2016 Week 35 2016-08-26 17:30:31 -07:00
Josh Cox
9e82ef979e Added a warning prompt if the user tries to use an API cert instead of a CLI cert
Summary: Fixes T9692. Instead of disallowing API tokens entirely, we're going to just warn the user that they might not want to do that. After that, they can proceed if they want to.

Test Plan:
Run arc install-certificate.
Manually go to `Settings → Conduit API Tokens` in the web UI.
Generate an API token explicitly, which should have the form api-******.
Paste that into the prompt on the CLI.
It will give you a warning prompt then ask if you'd like to proceed anyway (defaults to No).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T9692

Differential Revision: https://secure.phabricator.com/D16448
2016-08-25 11:34:34 -04:00
epriestley
e78618ce22 (stable) Promote 2016 Week 34 2016-08-20 16:01:47 -07:00
Alex Vandiver
89e8b48523 Update documentation for changed splitGitDiffPaths function
Summary:
The behavior (and name) of this function was changed in
D16405, but the documentation was not updated to reflect the new
contract.

Test Plan: Untested; pure doc changes.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16425
2016-08-19 14:55:33 -07:00
Luke081515
3ae0cc8d41 Avoid double [y/N] when updating a not owned revision
Summary:
Since 737f5c0df9 arcanist shows [y/N] two times, when arcanist asks you, if you want to proceed, if you want to update a not owned revision. Ths patch fixes
that, so that Arcanist shows [y/N] only once, like at other situations, when Arcanist asks you a question.
Ref T11489

Test Plan: Updated a not owned revision.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Tags: #arcanist

Maniphest Tasks: T11489

Differential Revision: https://secure.phabricator.com/D16415
2016-08-17 10:36:16 -07:00
epriestley
6507be27ae Fix handling of View Policy in CLI upload workflow for small, unique files
Summary:
Ref T7148. When uploading files from the CLI with a particular view policy, we may not respect it if the file is unique (so the data isn't already known) and small (so it doesn't invoke the chunker).

This is rare (and may never have happened outside of testing) because:

  - production dumps are always larger than the minimum chunk size;
  - only cluster stuff uses `setViewPolicy()`;
  - the default policy is "Administrators" anyway, which is safe.

However, I caught it in local testing, so fix it up.

Test Plan: Used `bin/host upload --file ...` to upload a small, unique file. Verified it uploaded with the correct custom view policy ("No One") rather than the default view policy ("Administrators").

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7148

Differential Revision: https://secure.phabricator.com/D16408
2016-08-17 09:04:01 -07:00
Alex Vandiver
d0957c3441 Parse git renames with inconsistent quoting or custom prefixes
Summary:
The previous parser failed when only one of the old/new filenames was
quoted, as with a rename of a Unicode filename to a non-Unicode
filename, or vice versa.  It also incorrectly parsed custom prefixes,
even going to far as to encode this logic in the tests: a diff of
"src/file dst/file" which is not a rename should not be recorded as
changing "src/file", but rather "file".

Switch to using the "rename from" / "rename to" as the source of truth
for old and current filenames when complex renames are done.  This
matches the logic that git itself uses to parse patches; the contents
of the `diff --git` line are merely viewed as a simplest-case
prediction, with renames handled later should it not match.

The diff parser already had logic to parse "rename from" / "rename to"
lines and extract their information.  As such, this diff consists
primarily of removing logic from the `splitGitDiffPaths` method, and
allowing it to quietly fail.

This resolves two ambiguity mentioned in comments and tests: in
renaming "old file old" to "file", as well as the renaming of
"old file with spaces" to "new file with spaces" when neither are
quoted.

Test Plan:
`arc unit`.  Many of the existing test cases no longer
applied to the `splitGitDiffPaths` method; they were moved into a new
test method which also supplies values for "rename from" and "rename
to" lines.

As noted in the summary, this alters one of the expected values of an
existing test.  Specifically, the following diff is a file addition of
`file` with custom prefixes, and not the addition of "dst/file":

```
diff --git src/file dst/file
new file mode 100644
index 0000000..1269488
--- /dev/null
+++ dst/file
@@ -0,0 +1 @@
+data
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16405
2016-08-16 17:45:51 -07:00
Alex Vandiver
ee6357386d Correctly parse file renames and copies from git diff --raw
Summary:
`parseGitRawDiff` dealt with the `A`, `M`, and `D` status flags from
`git diff --raw`, for file additions, modifications, and deletions
respectively.  However, it failed to cope with `C` and `R` flags, for
copies and renames.  Git version 2.9 and above default to resolving
renames, even in `git diff --raw` output, making this lack of support
only salient now (though users with Git's `diff.rename` set
encountered it previously).

Those two flags differ from the other three in that they offer both the
source and destination filename, separated by a tab.  As
`parseGitRawDiff` was not aware of this property, it returned a
"filename" of `"oldfile\tnewfile"`.  This is surfaced in several
places, including as passed to linters as a filename to check.
Needless to say, this file is nearly guaranteed to never exist on
disk.

Detect both the `C` and `R` flag types, and generate either a file
addition, or a pair of addition/deletion entries.

Test Plan:
Renamed a file, with a linter that printed each file it was
called with.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: jboning, Korvin

Differential Revision: https://secure.phabricator.com/D16387
2016-08-16 17:27:20 -07:00
epriestley
c9337c2ade (stable) Promote 2016 Week 32 2016-08-06 14:39:50 -07:00
epriestley
e5be662d15 Use --no-ext-diff in arc land call to git diff
Summary:
Fixes T11435. This isn't a perfect solution since there's a little code duplication, but a perfect solution is probably a bit more involved.

See T11435 for some discussion. In particular, most `git diff` commands already get this flag via `ArcanistGitAPI->getDiffBaseOptions()`.

Test Plan: Will land this change.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11435

Differential Revision: https://secure.phabricator.com/D16375
2016-08-06 09:00:01 -07:00
epriestley
3aa47195ef Set "history.immutable" to "false" explicitly in .arcconfig in Arcanist
Summary: Depends on D16364. See that revision for discussion.

Test Plan: Ran `arc get-config history.immutable` in `arcanist/`, saw setting.

Reviewers: chad, fooishbar

Reviewed By: fooishbar

Differential Revision: https://secure.phabricator.com/D16365
2016-08-03 08:13:09 -07:00
epriestley
f20d4b15c7 Add a lint error about use of PHP short array syntax ('[...]')
Summary: Ref T11409. Add lint to detect using `[...]` to define arrays. This doesn't work in PHP 5.2/5.3, which some of our users run.

Test Plan:
  - Ran `arc unit`.
  - Ran `arc lint src/applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php` to detect the issue in T11409.

Reviewers: yelirekim, chad

Reviewed By: chad

Maniphest Tasks: T11409

Differential Revision: https://secure.phabricator.com/D16357
2016-08-01 10:45:09 -07:00
epriestley
65cd42fb03 (stable) Promote 2016 Week 31 2016-07-30 05:34:53 -07:00
epriestley
06c641f92c Remove command spelling correction from Arcanist
Summary: Fixes T7489. Depends on D16332, which moved this code to libphutil.

Test Plan:
```
$ arc banch --bystatus
(Assuming 'banch' is the British spelling of 'branch'.)
(Assuming '--bystatus' is the British spelling of '--by-status'.)
...
```

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7489

Differential Revision: https://secure.phabricator.com/D16333
2016-07-27 09:35:28 -07:00
Rabah Meradi
1bedfdccd7 Fixes help message for stop command
Test Plan: arc help stop will display 'Stop tracking work...'

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: avivey, chad, epriestley

Differential Revision: https://secure.phabricator.com/D16310
2016-07-27 05:42:07 -07:00
Alex Vandiver
8f69a5c378 Use phutil functions to copy/move files
Summary:
The `cp` and `mv` commands, when run from a Windows
environment, error out.  Use library functions from `Filesystem`
for cross-platform compatibility.

Test Plan:
Ran `arc lint` with auto-fix lint errors on both Linux and
Windows.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Spies: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16273
2016-07-12 10:21:58 -07:00
epriestley
f1c45a3323 (stable) Promote 2016 Week 27 2016-07-01 16:22:36 -07:00
epriestley
4d4d16f259 Validate Arcanist install-certificate URIs more carefully
Summary: Fixes T11222. This was lazy-future-proofed for Conduit SSH support, but users are boundlessly creative. Check protocols explicitly.

Test Plan:
```
$ arc install-certificate a.b:1/
Usage Exception: Server URI "a.b:1/" must include the "http" or "https" protocol. It should be in the form "https://phabricator.example.com/".
```

  - Also went through a successful workflow with a URI in the form provided in the example.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11222

Differential Revision: https://secure.phabricator.com/D16188
2016-06-28 15:20:06 -07:00
epriestley
18b27b03fa (stable) Promote 2016 Week 25 2016-06-18 09:23:54 -07:00
epriestley
2374403e8f Remove the "you have not specified reviewers" prompt from the arc client
Summary:
Ref T4631. Ref T10939. I don't have any good solutions here; this is perhaps the least-bad one.

  - This prompt is misleading/confusing in the presence of Herald/Owners.
  - This prompt is likely of very little value for experienced reviewers.
  - When it works, this prompt may be of some value for new reviewers, but getting it wrong is probably more confusing than getting it right is helpful, and there is a more accurate version of the warning in the web UI that new users are likely to see.
  - In the long run, this code should not live in the client.

Test Plan: Created this revision without specifying reviewers, probably didn't get prompted.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4631, T10939

Differential Revision: https://secure.phabricator.com/D16139
2016-06-17 08:04:08 -07:00
epriestley
7b0aac5c6f (stable) Promote 2016 Week 24 2016-06-11 04:44:54 -07:00
epriestley
9c412dabf6 (stable) Promote 2016 Week 23 2016-06-11 04:29:00 -07:00
epriestley
c13e5a6295 Use an HTTPEngineExtension to implement "https.blindly-trust-domains" in Arcanist
Summary: Ref T10227. This converts weird hard-codey magic to the new HTTPEngineExtension.

Test Plan: See D16090.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10227

Differential Revision: https://secure.phabricator.com/D16091
2016-06-09 12:02:15 -07:00
epriestley
c75b671b22 Use "internal" smoothing for code diffs in Arcanist
Summary: Ref T7643. This moves the prefix/suffix smoothing behavior back to the old one, which seems better for code diffs.

Test Plan: `arc unit --everything`

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16074
2016-06-07 14:15:20 -07:00
epriestley
41e8e30e8c Use EditDistanceMatrix diff smoothing in Arcanist
Summary:
Ref T7643. We've done the smoothing from D16068 for a long time, it just wasn't part of EditDistanceMatrix.

Since it now is, call it instead of keeping a copy of the logic around.

Previously, the unit tests were testing un-smoothed diffs. Just have them test smoothed diffs instead, since nothing actually uses unsmoothed diffs.

Test Plan: Pasted a raw diff into the web UI, got a sensible inline diff for it.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16069
2016-06-07 09:13:34 -07:00
Aviv Eyal
ca33240942 Don't specify size 0 for deleted files
Summary: See D15828 - arc is reporting file size as `0` for unexisting files - make it stop.

Test Plan: `arc diff` with empty, deleted, added files - see size reported as `null` when appropriate.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: chad, Korvin

Differential Revision: https://secure.phabricator.com/D16059
2016-06-06 20:51:16 +00:00
epriestley
7891df6f25 Read arc aliases from all available configuration files
Summary: Fixes T10431. Updates the getAliases() method to read every `arc` configuration file.

Test Plan:
Added an `arc duck` alias to `/etc/arcconfig`, ran `arc duck`, saw "quack".

Added an `arc pig` alias to `~/.arcrc` via `arc alias`, ran `arc pig`, saw "oink oink".

Reviewers: nevogd, chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: eadler, epriestley

Tags: #twitter

Maniphest Tasks: T10431

Differential Revision: https://secure.phabricator.com/D15342
2016-06-06 13:15:59 -07:00
Allan Jude
19608cffe6 SVN buildSyntheticAdditionDiff: exit sooner if path is a directory
Summary:
When doing svn copy, or svn mv, a SynthenticAdditionDiff is generated.

If the path is a directory, an error will occur when checking the
mime-type of the directory. Immediately after the properties check,
the function returns null if the path is a directory. Move this
check to before the properties check to avoid exiting with an error.

```
Command failed with error #1!
COMMAND
svn propget 'svn:mime-type' '/home/trasz/svn/ports/cad/py-pycam'@

STDOUT
(empty)

STDERR
svn: warning: W200017: Property 'svn:mime-type' not found on '/home/trasz/svn/ports/cad/py-pycam@'
svn: E200000: A problem occurred; see other errors for details

(Run with `--trace` for a full exception trace.)
```

Test Plan: Created differentials of changes with `svn copy` and `svn mv`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Tags: #subversion

Differential Revision: https://secure.phabricator.com/D15985
2016-06-05 15:12:46 -07:00
epriestley
0249f90a9a (stable) Promote 2016 Week 21 2016-05-20 16:24:48 -07:00
epriestley
2234c8cacc Fix arc which for svn repos
Summary:
`arc which` is currently broken for svn repos.

Fixes T6635

(I think I independently wrote an identical change to yours)

Test Plan: `∴../../p/arcanist/bin/arc which` on a svn repo.

Reviewers: aik099, epriestley, #blessed_reviewers

Reviewed By: aik099, epriestley, #blessed_reviewers

Subscribers: aik099, Korvin

Maniphest Tasks: T6635

Differential Revision: https://secure.phabricator.com/D15922
2016-05-16 12:54:37 +00:00
epriestley
6d175516f5 (stable) Promote 2016 Week 18 2016-04-30 05:01:28 -07:00
Eitan Adler
c58f1b9a25 Prefer pip to easy_install
Summary:
Prefer pip to easy_install
also fixes incorrect install instructions for closure linters

Fixes T10892
Ref T10038

Test Plan: inspection

Reviewers: avivey, #blessed_reviewers, epriestley, tjstum

Reviewed By: avivey, #blessed_reviewers, epriestley, tjstum

Subscribers: avivey, Korvin

Maniphest Tasks: T10038, T10892

Differential Revision: https://secure.phabricator.com/D15818
2016-04-29 15:45:11 +00:00
epriestley
768e1a56bc When running XHPAST unit tests, include the "syntax error" lint rule
Summary:
See rARC3ffed59bd7. Currently, when a unit test includes a syntax error, it is raised in an unclear way ("error at line 10, char 1: XHP1 Unknown lint message!").

This is because each test case only activates rules it wants to test, so we lose the ID/name for the syntax message. However, we always want to test this and the lint engine can always raise it.

To get a better error message, include it unconditionally. So a test for rule `X` really tests two rules: syntax, and `X`.

Test Plan:
Ran `arc unit` at HEAD, got a better test failure:

```
   FAIL  ArcanistCallTimePassByReferenceXHPASTLinterRuleTestCase::testLinter
In 'call-time-pass-by-reference.lint-test', expected lint to raise error on line 10 at char 8, but no error was raised. Actually raised:
  error at line 10, char 1: XHP1 PHP Syntax Error!
```

NOTE: This doesn't pass tests yet, it just makes the test failure easier to understand. I'll see about fixing the test in the next change.

Reviewers: chad, richardvanvelzen

Reviewed By: richardvanvelzen

Differential Revision: https://secure.phabricator.com/D15819
2016-04-29 06:30:04 -07:00
Richard van Velzen
3ffed59bd7 Update xhpast linter rules for new function AST format
Summary: See D15678. A node containing a return type hint is added right before the statement body node. This updates all relevant linter rules to now retrieve the body from the correct index.

Test Plan: Ran `arc unit --everything`, inspected every single message to make sure all xhpast test cases succeeded. Also grepped for `getChildByIndex(5` and `getChildOfType(5`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15814
2016-04-29 14:38:10 +02:00
Joshua Spence
ea6fc77892 Fix incorrect variable for linter standards
Summary: It is currently not possible to apply multiple linter standards because `$value` was used instead of `$standard`.

Test Plan: Was able to apply multiple linter standards.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: eadler, thaiphv, Korvin

Differential Revision: https://secure.phabricator.com/D15212
2016-04-29 08:00:07 +00:00
Jon Parise
9b07d1c480 Recognize error codes from Flake8 extensions
Summary:
Flake8 extensions are allowed to use their own letter-prefixed codes. For
example, the flake8-debugger extension emits 'T002'-tagged messages.

This change relaxes getLintCodeFromLinterConfigurationKey() to also recognize
extension codes. Otherwise, attempting to configure message severities for
e.g. 'T002' would result in an exception.

Messages from extensions continue to default to ERROR severity, as they did
before this change.

Test Plan:
Successfully reduced the severity of 'T002' to a warning via .arclint:

    "severity": {
        "T002": "warning"
    }

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15810
2016-04-27 15:11:46 -07:00
epriestley
789aff85db (stable) Promote 2016 Week 17 2016-04-22 17:09:59 -07:00
epriestley
a2ab38df78 Improve performance of arc branch in Git with many branches
Summary:
This is mostly just a personal quality-of-life fix. I run this command fairly often and having it return a little faster is nice.

This replaces a `git show` for each individual branch with a big `git for-each-ref` which we were already running anyway. This is quite a bit faster.

This command also occasionally hangs or segfaults for me while executing the huge pile of subprocesses. This is unreliable to reproduce, probably some bug in some PHP extension I have, and likely hard to narrow down, and this approach is better in every way anyway.

Test Plan:
  - Ran `arc branch` in Git, observed faster output (in my `phabricator/`, about 2000ms -> 1200ms).
  - Ran `arc feature` in Mercurial.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15735
2016-04-16 16:39:32 -07:00