]> khamidou — GitHub mirrors - arcanist.git/log
arcanist.git
13 years agoMinor, fix an exception variable.
epriestley [Mon, 11 Feb 2013 12:54:20 +0000 (04:54 -0800)]
Minor, fix an exception variable.

Auditors: DurhamGoode

13 years agoDeprecate phutil_escape_html()
vrana [Sat, 9 Feb 2013 23:04:20 +0000 (15:04 -0800)]
Deprecate phutil_escape_html()

Summary:
My original idea was to return safe HTML from this function.
But we are down to 20 occurrences in Phabricator and you shouldn't need this function in safe HTML world at all.

Test Plan:
  $ arc lint src/applications/audit/controller/PhabricatorAuditListController.php

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4890

13 years agoSupport arc diff --edit under hg
Nick Pellegrino [Sat, 9 Feb 2013 19:24:54 +0000 (11:24 -0800)]
Support arc diff --edit under hg

Summary: T1571

Test Plan: epriestley says it works

Reviewers: epriestley

Reviewed By: epriestley

CC: kwadwon, aran, Korvin
Differential Revision: https://secure.phabricator.com/D4883

13 years agoAdd lint warnings about use of phutil_render_tag and javelin_render_tag
epriestley [Sat, 9 Feb 2013 01:38:56 +0000 (17:38 -0800)]
Add lint warnings about use of phutil_render_tag and javelin_render_tag

Summary: Raise deprecation warnings for these methods. I won't commit this until the phutil_tag branch merges.

Test Plan: Unit tests.

Reviewers: vrana

Reviewed By: vrana

CC: aran
Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4770

13 years agoDisplay other locations of Reused lint errors
vrana [Fri, 8 Feb 2013 23:04:32 +0000 (15:04 -0800)]
Display other locations of Reused lint errors

Summary: It's not trivial to find them inside 700+ lines long functions.

Test Plan:
Linted `reused-iterators.lint-test` renamed to `_.php`, saw other locations.
Repeated for `reused-local.lint-test`.
Repeated for `duplicate-key-in-array.lint-test`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4871

13 years agoMake 'arc diff X' in mercurial match git by using the GCA of X as the base
durham [Fri, 8 Feb 2013 15:09:30 +0000 (07:09 -0800)]
Make 'arc diff X' in mercurial match git by using the GCA of X as the base

Summary:
Previously 'arc diff X' with mercurial meant to use X as the base
to diff against.  Now it means use gca(X,working directory) as the base to
diff against.  This matches the git behavior.

Test Plan:
Ran 'arc diff master' on a repo where master was ahead of the feature branch.
Verified that the diff result included only the diffs in the feature branch.

Reviewers: epriestley, sid0, bos, dschleimer

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4865

13 years agoImprove performance of mercurial arc diff
durham [Fri, 8 Feb 2013 13:54:32 +0000 (05:54 -0800)]
Improve performance of mercurial arc diff

Summary:
arc diff on large mercurial repos was taking 14 seconds just to get
to the commit message prompt.  With these optimizations it takes 4.

- "ancestor(.) - ancestor(XYZ)" is expensive because it has to build the
entire 400000+ revision history for both.  "XYZ::. - XYZ" is much cheaper
because it only looks at the revisions between XYZ and the working directory.

- "hg outgoing" has to talk to the server, which is slow.  "hg log -r draft()"
gives us the same information and is much cheaper.  We fall back to 'outgoing'
on older versions of mercurial.

Of the remaining 4 seconds, 2.5 are spent in 'hg status', which is a bit harder
improve.

Test Plan: Ran arc diff on our hg repo. Verified it ran faster and the diff was created.

Reviewers: epriestley, sid0, bos, dschleimer

Reviewed By: epriestley

CC: aran, Korvin, tido
Differential Revision: https://secure.phabricator.com/D4838

13 years agoUpload binary files diffs in parallel
vrana [Thu, 7 Feb 2013 04:24:31 +0000 (20:24 -0800)]
Upload binary files diffs in parallel

Summary: Makes sense after D2471.

Test Plan:
Swapped two binary files, ran `arc diff --only`.
Saw time 3.797 s instead of 4.361 s.

Changed `file.upload` to `file.uploa`, saw proper error.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4847

13 years agoRestore kept branch after landing
vrana [Thu, 7 Feb 2013 02:44:55 +0000 (18:44 -0800)]
Restore kept branch after landing

Test Plan: Ran it separately.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4846

13 years agoImprove error message for phutil missing symbols
epriestley [Thu, 7 Feb 2013 03:11:06 +0000 (19:11 -0800)]
Improve error message for phutil missing symbols

Summary: This is fairly confusing. Make the error message suggest the common remedy (update libphutil).

Test Plan: Eyeballed it.

Reviewers: Afaque_Hussain, btrahan, vrana

Reviewed By: Afaque_Hussain

CC: aran
Differential Revision: https://secure.phabricator.com/D4834

13 years agoMake "arc patch" read `authorName` and `authorEmail`
epriestley [Wed, 6 Feb 2013 04:11:39 +0000 (20:11 -0800)]
Make "arc patch" read `authorName` and `authorEmail`

Summary: If provided, have `arc patch` use `authorName` / `authorEmail`. This simplifies handling and makes patches more portable between version control systems (previously, information was generated in the diff's VCS, regardless of which VCS it was being applied to).

Test Plan: Created a diff with author `derp <derp@derp.com>`, ran `arc patch --diff x`, got a local commit with that author.

Reviewers: btrahan, edward, vrana

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4827

13 years agoRecord commit email information from `arc`
epriestley [Wed, 6 Feb 2013 04:11:20 +0000 (20:11 -0800)]
Record commit email information from `arc`

Summary:
Record author email information in `arc diff`, so we can recreate it in `arc patch` and elsewhere without creating any kind of email exposure issues.

In Mercurial, we currently store the whole string ("username <email@domain.com>"). Make this consistent with Git.

Test Plan: Created git and hg diffs, saw authorEmail populated.

Reviewers: btrahan, edward, vrana

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4825

13 years agoImplement hook for checking switch lint
vrana [Tue, 5 Feb 2013 19:00:07 +0000 (11:00 -0800)]
Implement hook for checking switch lint

Summary:
We want to use it for `yield` and `invariant_violation()` which throws.
Having node instead of token would be better but this would be enough.

Test Plan: Implemented a hook in FB repo and added a test case there.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4821

13 years agoAllow `arc diff` and similar to run on systems with no `git`
epriestley [Mon, 4 Feb 2013 19:34:53 +0000 (11:34 -0800)]
Allow `arc diff` and similar to run on systems with no `git`

Summary:
We assume `git` is available now, but should not. Specifically, if a user runs a working copy operation like `arc list` in an SVN working copy without `git` available, they get this error: P707

We interpret git errors very narrowly; be more liberal in how we interpret them. This assumes users working with `git` will have a functional `git`, but this seems like a reasonable assumption and lets us remove some error text matching code.

Test Plan: Changed `git` to `girt`, ran `arc list`, saw a reasonable exception. Changed back to `git`, saw git detected.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: svemir, aran
Differential Revision: https://secure.phabricator.com/D4804

13 years agoFix dynamic string usage as safe input
vrana [Mon, 4 Feb 2013 19:27:16 +0000 (11:27 -0800)]
Fix dynamic string usage as safe input

Test Plan: Copied the code in a script, changed `phutil_passthru()` to `echo csprintf()` and ran it.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4805

13 years agoFix dynamic string usage as safe input
vrana [Sun, 3 Feb 2013 23:00:23 +0000 (15:00 -0800)]
Fix dynamic string usage as safe input

Summary: I somehow missed it.

Test Plan: Sent this diff by different copy of Arcanist.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4800

13 years agoFix dynamic string usage as safe input
vrana [Sat, 2 Feb 2013 21:07:39 +0000 (13:07 -0800)]
Fix dynamic string usage as safe input

Summary: This fixes some real issues.

Test Plan:
  $ arc lint

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, btrahan
Differential Revision: https://secure.phabricator.com/D4795

13 years agoLint dynamic string usage in parameters treated as safe
vrana [Sat, 2 Feb 2013 20:33:22 +0000 (12:33 -0800)]
Lint dynamic string usage in parameters treated as safe

Summary:
This disallows code like this:

  $cmd = 'ls';
  execx($cmd);

But I guess it's not that big deal?

Test Plan: Linted whole Arcanist and Phabricator codebases, most parts looks fixable.

Reviewers: epriestley

CC: nh, aran, Korvin
Differential Revision: https://secure.phabricator.com/D4794

13 years agoDispatch event after collecting changes in diff
vrana [Fri, 1 Feb 2013 22:59:09 +0000 (14:59 -0800)]
Dispatch event after collecting changes in diff

Summary:
FB currently starts Sandcastle push before starting the diff workflow.
If `arc diff` commits something then we need to restart the push.
I want to avoid this by starting the push after commit.

Test Plan: Will test after implementing the listener.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4785

13 years agoAdd typehint to setting workflow configuration
vrana [Fri, 1 Feb 2013 19:47:39 +0000 (11:47 -0800)]
Add typehint to setting workflow configuration

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4784

13 years agoHandle $var::method() in XHPAST linter
vrana [Fri, 1 Feb 2013 19:17:46 +0000 (11:17 -0800)]
Handle $var::method() in XHPAST linter

Test Plan: Didn't see a fatal in new test case.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4783

13 years agoMake British spelling stricter
vrana [Fri, 1 Feb 2013 00:28:51 +0000 (16:28 -0800)]
Make British spelling stricter

Summary: This is pretty lame but I didn't have a better idea.

Test Plan:
  $ arc test # previously translated as list
  $ arc lst
  $ arc brnach

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4773

13 years agoFix getting changed files in SVN
vrana [Thu, 31 Jan 2013 20:21:26 +0000 (12:21 -0800)]
Fix getting changed files in SVN

Summary:
This is pretty awkward but I don't have anything better.

Also don't compute cache key if caching is disabled.

Test Plan:
  $ svn diff --xml --summarize '' -r 701319:HEAD
  $ svn diff --xml --summarize svn+ssh://tubbs/svnroot/projects/lolbunny -r 701319:HEAD

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4771

13 years agoDisable pull stat in arc land
vrana [Thu, 31 Jan 2013 01:57:06 +0000 (17:57 -0800)]
Disable pull stat in arc land

Test Plan:
  $ git pull --no-stat

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4754

13 years agoAdd --skip-arcconfig option
Nick Harper [Thu, 31 Jan 2013 00:26:41 +0000 (16:26 -0800)]
Add --skip-arcconfig option

Summary:
Continuation of D4732 - when we don't care about loading an arcconfig,
allow that to be specified.

Test Plan: chmod -r .arcconfig; bin/arc help --skip-arcconfig

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4750

13 years agoMove `isConstantString()` to base class
vrana [Wed, 30 Jan 2013 20:24:41 +0000 (12:24 -0800)]
Move `isConstantString()` to base class

Summary: This can be useful by itself, we want to use it in FB linter.

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4744

13 years agoSplit php-tags-bad.lint-test to two tests
vrana [Wed, 30 Jan 2013 20:44:06 +0000 (12:44 -0800)]
Split php-tags-bad.lint-test to two tests

Summary: D1818 effectivelly disabled this test case.

Test Plan: This diff.

Reviewers: epriestley, nh

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4746

13 years agoExpose `--coverage` and `--no-coverage` flags from `arc diff`
epriestley [Wed, 30 Jan 2013 20:35:30 +0000 (12:35 -0800)]
Expose `--coverage` and `--no-coverage` flags from `arc diff`

Summary: Currently, we don't expose these at top level, so you can't disable coverage if your coverage is explosively broken. Expose them as passthrough arguments.

Test Plan:

  - Touched a file in `arc` which triggered unit tests.
  - Without `xdebug` installed:
    - Ran `arc diff --preview`, `arc diff --preview --no-coverage` (both fine).
    - Ran `arc diff --preview --coverage`, got exception about coverage not being available.
  - Installed `xdebug`.
    - Ran `arc diff --preview`, got coverage.
    - Ran `arc diff --preview --coverage`, got coverage.
    - Ran `arc diff --preview --no-coverage`, no coverage.

Reviewers: indiefan, btrahan, vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4745

13 years agoUse all changed files since base revision in repository cache key
vrana [Tue, 29 Jan 2013 23:57:42 +0000 (15:57 -0800)]
Use all changed files since base revision in repository cache key

Test Plan: Added debug output for repository version, linted, committed, linted again, saw the same version, changed file, saw different version.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4731

13 years agoRestore directory after executing ArcanistBundleTestCase
epriestley [Wed, 30 Jan 2013 19:24:41 +0000 (11:24 -0800)]
Restore directory after executing ArcanistBundleTestCase

Summary:
This test currently chdir()'s into a directory which is later removed. If another test tries to run a shell script while the CWD is invalid, the shell may emit this to stderr:

  shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Among other things, this can cause the XHPAST test to fail, because it detects syntax errors by examining stderr.

Instead, retore the directory.

Test Plan: Ran "arc unit --everything", which could previously fail if XHPAST ran after Bundle.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4738

13 years agoReset master after unsuccessful push
vrana [Tue, 29 Jan 2013 01:05:09 +0000 (17:05 -0800)]
Reset master after unsuccessful push

Test Plan: None.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4717

13 years agoSeparate Phutil specific lint rules from XHPAST
vrana [Tue, 29 Jan 2013 06:03:03 +0000 (22:03 -0800)]
Separate Phutil specific lint rules from XHPAST

Summary: Also provides an example how to build custom linter using XHPAST.

Test Plan: Added debug output to `willLintPaths()`, verified that each path is parsed only once.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4718

13 years agoAllow running `arc land` after `git svn rebase`
vrana [Mon, 28 Jan 2013 23:54:37 +0000 (15:54 -0800)]
Allow running `arc land` after `git svn rebase`

Summary: `git pull` may fail in git-svn after rebasing (which is a side effect of dcommit).

Test Plan:
  $ git svn rebase
  $ git log trunk..master
  $ git pull --ff-only; echo $?

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4716

13 years agoCorrect a bunch of mercurial revset construction
epriestley [Tue, 29 Jan 2013 00:28:14 +0000 (16:28 -0800)]
Correct a bunch of mercurial revset construction

Summary: Possibly improves T2387 state of the world?

Test Plan: not yet

Reviewers: bos, DurhamGoode

Reviewed By: DurhamGoode

CC: aran
Maniphest Tasks: T2387

Differential Revision: https://secure.phabricator.com/D4712

13 years agoProvide hgsprintf() for building hg revsets
epriestley [Tue, 29 Jan 2013 00:27:47 +0000 (16:27 -0800)]
Provide hgsprintf() for building hg revsets

Summary: I guess this is correct? See T2387 for discussion.

Test Plan: Unit tests.

Reviewers: bos, DurhamGoode

Reviewed By: DurhamGoode

CC: aran
Maniphest Tasks: T2387

Differential Revision: https://secure.phabricator.com/D4711

13 years agoIgnore untracked files in lint repository cache key
vrana [Mon, 28 Jan 2013 23:18:12 +0000 (15:18 -0800)]
Ignore untracked files in lint repository cache key

Summary: Some people have 2GB+ untracked files in repo which significantly slows down this or even crashes it.

Test Plan: Added a debug output here and linted repo with untracked path.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, arudolph
Differential Revision: https://secure.phabricator.com/D4713

13 years agolint_untracked
vrana [Mon, 28 Jan 2013 23:15:18 +0000 (15:15 -0800)]
lint_untracked

13 years agoFix an escaping issue with "svn commit"
epriestley [Mon, 28 Jan 2013 22:11:31 +0000 (14:11 -0800)]
Fix an escaping issue with "svn commit"

Summary: Fixes T2438. We currently escape everything with '@', but SVN rejects that for '.'

Test Plan:
Unit tests. Performed this commit:

  $ svn st
   M      .
  A       x@123
  $ arc commit --conduit-uri=http://local.aphront.com:8080/ --revision 53

      Revision 'D53: asdf' has not been accepted. Commit this revision anyway?
      [y/N] y

  Committing 'D53: asdf'...
  Sending        .
  Adding         x@123
  Transmitting file data .
  Committed revision 37.
  Done.

I grepped for more '@' adding but couldn't find any. It's a bit tricky to grep for though, so it's possible I missed some.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran, mbishopim3
Maniphest Tasks: T2438

Differential Revision: https://secure.phabricator.com/D4703

13 years agoAdded base test result parser class. Implemented Go test result parser based on Go...
indiefan [Mon, 28 Jan 2013 01:16:50 +0000 (17:16 -0800)]
Added base test result parser class. Implemented Go test result parser based on Go's built in test utility output.

Test Plan: Ran PhpunitTestEngine unit test and used both test result parsers to generate test results.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, aurelijus
Differential Revision: https://secure.phabricator.com/D4676

13 years agoAdded paths to search for python linters
Jesse Mullan [Sat, 26 Jan 2013 13:31:25 +0000 (05:31 -0800)]
Added paths to search for python linters

Summary: Added paths to search for python linters

Test Plan: Linted in ubuntu

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2414

Differential Revision: https://secure.phabricator.com/D4648

13 years agoSupport PHPUnit 3.7 message changes
Aurelijus [Sat, 26 Jan 2013 01:19:25 +0000 (17:19 -0800)]
Support PHPUnit 3.7 message changes

Summary: PHPUnit 3.7 now includes user message as well.

Test Plan: Ran phpunit tests

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4662

13 years agoRaise a lint warning on array_combine(x, x)
epriestley [Sat, 26 Jan 2013 01:06:49 +0000 (17:06 -0800)]
Raise a lint warning on array_combine(x, x)

Summary: Suggest array_fuse().

Test Plan:
Unit tests, and:

  $ arc lint --lintall src/unit/engine/phutil/ArcanistPhutilTestCase.php
  >>> Lint for src/unit/engine/phutil/ArcanistPhutilTestCase.php:

     Warning  (XHP37) array_combine() Unreliable
      Prior to PHP 5.4, array_combine() fails when given empty arrays. Prefer
      to write array_combine(x, x) as array_fuse(x).

               252     $callable,
               253     $exception_class = 'Exception') {
               254     return $this->tryTestCases(
      >>>      255       array_combine(array_keys($map), array_keys($map)),
               256       array_values($map),
               257       $callable,
               258       $exception_class);

Reviewers: btrahan, vrana, chad

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4659

13 years agoDecoupling phpunit test parsing from running and gathering. Should enable third party...
indiefan [Sat, 26 Jan 2013 01:06:20 +0000 (17:06 -0800)]
Decoupling phpunit test parsing from running and gathering. Should enable third party test engines to reuse common business logic around phpunit without requiring common logic for the typically application-specific running and gathering.

Test Plan: Ran PhpunitTestEngine unit test. Also used refactored PhpunitTestEngine to run phpunit tests.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, aurelijus
Differential Revision: https://secure.phabricator.com/D4651

13 years agoFix hg arc land on hg-svn repos
durham [Fri, 25 Jan 2013 19:52:14 +0000 (11:52 -0800)]
Fix hg arc land on hg-svn repos

Summary:
arc land on a hg-svn repository would fail because arc land
uses 'hg push -r' to specify which revs to push which is not supported
by hg-svn. Now we just use 'hg push' which, when used against svn, only
pushes the current branch (which happens to be the branch we're trying to land).

We can't use standard 'hg push' for non-svn repos though because when used
against a vanilla hg repo 'hg push' pushes all branches.

Also remove --new-branch from 'hg push' because it's extremely
unlikely that a person wants to create a new branch on the server via
arc land.

Test Plan:
Ran arc land on a normal hg repo, verified it used 'hg push -r'.
Ran arc land on a hg-svn repo, verified it used 'hg push' and it pushed the
correct changes.

Reviewers: epriestley, sid0, dschleimer

Reviewed By: epriestley

CC: bos, aran, Korvin
Maniphest Tasks: T2403

Differential Revision: https://secure.phabricator.com/D4653

13 years agoRevert "Delete useless code in ArcanistBaseWorkflow"
vrana [Fri, 25 Jan 2013 00:32:15 +0000 (16:32 -0800)]
Revert "Delete useless code in ArcanistBaseWorkflow"

This reverts commit rARC501e2b7.
We call this method from FB workflow.
I'll commit it again in two weeks.

13 years agoCache results of repository linters
vrana [Wed, 23 Jan 2013 21:06:45 +0000 (13:06 -0800)]
Cache results of repository linters

Summary:
The cache key is repository base revision and hash of all modified files.
It isn't perfect in SVN where every file might have a different revision.
It's also suboptimal as just committing or amending changes the cache key even if the files contents weren't modified.
We can improve it later, perhaps by using previous revision and files modified since it.

Test Plan:
Changed granularity of XHPAST linter to repository.
Linted the same repo twice, verified that it was read from cache the second file.
Changed a single file, verified that all files were re-linted.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4608

13 years agoDon't bail on no effect exception
vrana [Thu, 24 Jan 2013 22:45:21 +0000 (14:45 -0800)]
Don't bail on no effect exception

Summary: The main reason for this is to not exit with 1 when no paths are lintable (which is more success than failure).

Test Plan:
Returned empty array from `buildLinters()`, then:

  $ arc lint
  $ echo $? # 0

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin
Differential Revision: https://secure.phabricator.com/D4625

13 years agoFix `arc diff --no-ansi`
epriestley [Thu, 24 Jan 2013 22:28:28 +0000 (14:28 -0800)]
Fix `arc diff --no-ansi`

Summary: Currently, we get an exception on empty %Ls for `arc diff --no-ansi` or similar (see P698).

Test Plan: Ran `arc diff --no-ansi`.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4624

13 years agoMark deleted paths as removed in committing
vrana [Wed, 23 Jan 2013 21:53:30 +0000 (13:53 -0800)]
Mark deleted paths as removed in committing

Test Plan: Deleted file in Git, ran `arc diff`, confirmed the question, saw the file as deleted.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4603

13 years agoDelete useless code in ArcanistBaseWorkflow
vrana [Wed, 23 Jan 2013 21:08:58 +0000 (13:08 -0800)]
Delete useless code in ArcanistBaseWorkflow

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4601

13 years agoAdded support for hg diffs generated in git mode
Asher Baker [Wed, 23 Jan 2013 02:13:53 +0000 (18:13 -0800)]
Added support for hg diffs generated in git mode

Summary: Fixes T2112. These are fairly common now, and are used as the storage format for `hg export` and mq in most installs.

Test Plan: Ran unit tests, used `arc patch --patch`, uploaded some diffs manually.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2112

Differential Revision: https://secure.phabricator.com/D4592

13 years agoDon't use xhpast binary to compute xhpastlinter cache version if the binary doesn...
epriestley [Wed, 23 Jan 2013 01:16:37 +0000 (17:16 -0800)]
Don't use xhpast binary to compute xhpastlinter cache version if the binary doesn't exist

Summary: The binary may not be built, in which case this raises a warning.

Test Plan: Will make @zeeg test.

Reviewers: zeeg, vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4569

13 years agoAllow hg arc land when no rebase is necessary
durham [Tue, 22 Jan 2013 22:29:00 +0000 (14:29 -0800)]
Allow hg arc land when no rebase is necessary

Summary:
Previously, trying to arc land in a mercurial repo would
fail if the local branch was already at the tip of the onto branch
(since hg rebase exited with code 1).  This change makes it check
if a rebase is needed before executing the rebase.

Test Plan:
hg init foo
cd foo
hg bookmark master
touch a && hg add a && hg commit -ma
// setup your .arcconfig
cd ..
hg clone foo foo2
cd foo2
hg bookmark mybook
touch b && hg add b && hg commit -mb
arc land --onto master --revision <your rev number>

Arc land should succeed.  I also tried landing when a rebase was
necessary and it still worked.

Reviewers: epriestley, dschleimer, bos

Reviewed By: epriestley

CC: sid0, aran, Korvin
Differential Revision: https://secure.phabricator.com/D4588

13 years agoFix PHT linter
vrana [Sat, 19 Jan 2013 18:26:24 +0000 (10:26 -0800)]
Fix PHT linter

Summary: Variables in strings and concatenation lists.

Test Plan:
New unit tests.

  preg_match('/^((?>[^$\\\\]*)|\\\\.)*$/s', str_repeat('a', 1e6));

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4540

13 years agoWarn against usage of nowdoc
vrana [Sat, 19 Jan 2013 17:19:21 +0000 (09:19 -0800)]
Warn against usage of nowdoc

Summary: Also include binary hash in the version.

Test Plan: New unit test.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4535

13 years agoSet used variable
vrana [Fri, 18 Jan 2013 21:32:48 +0000 (13:32 -0800)]
Set used variable

13 years agoFix arc diff when run from a git submodule
Nick Harper [Thu, 17 Jan 2013 19:28:13 +0000 (11:28 -0800)]
Fix arc diff when run from a git submodule

Summary:
A git submodule looks a lot like a normal git repo, but the .git
directory is replaced with a file that git reads to find the real
location of the git directory. When arcanist tries to write a file into
a directory inside of there, it was failing silently, and then crashing
silently when it couldn't read results back out. Instead of assuming the
git directory is a directory named .git at the toplevel of the tree, we
use the appropriate git command to get the correct git directory.

Test Plan: submit a diff from a submodule

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4482

13 years agoAllow pht(<<<HEREDOC ... HEREDOC)
epriestley [Wed, 16 Jan 2013 22:57:10 +0000 (14:57 -0800)]
Allow pht(<<<HEREDOC ... HEREDOC)

Summary: Don't raise lint on heredoc literals.

Test Plan: Linted pht() + heredoc in D4477.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4478

13 years agoInclude real PEP8 version and options in lint cache key
vrana [Wed, 16 Jan 2013 20:10:17 +0000 (12:10 -0800)]
Include real PEP8 version and options in lint cache key

Summary: This should be done for all external and configurable linters.

Test Plan: Linted file with lint problems, changed options, relinted.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4475

13 years agoFix whitespace around else
vrana [Wed, 16 Jan 2013 20:15:46 +0000 (12:15 -0800)]
Fix whitespace around else

13 years agoCache stopped paths in lint
vrana [Tue, 15 Jan 2013 21:47:11 +0000 (13:47 -0800)]
Cache stopped paths in lint

Summary:
If linter with file cache granularity stops linting then we don't run it on the same path next time.
But we still run linters with non-file cache granularity causing that they run even on the paths that would be stopped otherwise.

Test Plan:
Put global granularity linter after Generated linter.
Caused an error from this linter but in ignored path.
Verified that 'stopped' is saved in `lint-cache.json`.
Linted the same files second time, verified that the path is still skipped (wasn't before).

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4446

13 years agoUse assert_instances_of(, 'array')
vrana [Sat, 12 Jan 2013 04:12:01 +0000 (20:12 -0800)]
Use assert_instances_of(, 'array')

Summary: To have at least one real callsite.

Test Plan:
  $message = new ArcanistLintMessage();
  $message->setOtherLocations(array());
  $message->setOtherLocations(array(array()));
  $message->setOtherLocations(array(1));

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4419

13 years agoDisplay other locations of lint errors in console renderer
vrana [Fri, 11 Jan 2013 23:23:47 +0000 (15:23 -0800)]
Display other locations of lint errors in console renderer

Test Plan: Created function named `f_a`, manually set other location.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4412

13 years agoAdd hook after running linters
vrana [Fri, 11 Jan 2013 22:11:38 +0000 (14:11 -0800)]
Add hook after running linters

Summary: This resolves D4380#7 by reverting https://secure.phabricator.com/D4380?vs=9112&id=9123.

Test Plan: Used it in our linters.

Reviewers: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4409

13 years agoFormat whitespace in XHPAST linter
vrana [Fri, 11 Jan 2013 20:38:08 +0000 (12:38 -0800)]
Format whitespace in XHPAST linter

Test Plan: Linted a method named `f_a`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4405

13 years agoAllow specifying multiple locations of the same lint error
vrana [Thu, 10 Jan 2013 23:03:33 +0000 (15:03 -0800)]
Allow specifying multiple locations of the same lint error

Summary:
Some errors (duplicate declaration, invalid number of arguments) have more related places.
We need to notify user if he changes any related place.
This could be currently achieved by triggering errors instead of warnings or by including both files in the range (impossible if the locations are in different files) or by issuing multiple errors.
All options are too aggressive.

Test Plan: Issued error on unmodified line with other location on modified line.

Reviewers: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4392

13 years agoFix checking for lint binary paths
vrana [Thu, 10 Jan 2013 23:22:49 +0000 (15:22 -0800)]
Fix checking for lint binary paths

Summary: Like D4379.

Test Plan:
  $ arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4391

13 years agoAdd some new misspellings of "hierarchy"
Gregor Stocks [Thu, 10 Jan 2013 22:32:23 +0000 (14:32 -0800)]
Add some new misspellings of "hierarchy"

Summary: turns out people really like misspelling "hierarchy"

Test Plan: hope

13 years agoRun all willLintPaths() before any lintPath()
vrana [Wed, 9 Jan 2013 21:00:45 +0000 (13:00 -0800)]
Run all willLintPaths() before any lintPath()

Summary:
FB runs some linters on background and it's a magnificent hack using `ParallelLinter` (two instances), `BackgroundLinter` and `FutureLinter`.
I want to simplify this by resolving the futures in engine instead of in some virtual linter.
It also seems like a better place to do it.
It should also fix caching problems I have with them (because the virtual linters don't know about the cache at all).

Test Plan: None yet.

Reviewers: epriestley, nh

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4380

13 years agoGenerate Git patches with "\n" metadata line endings unconditionally
epriestley [Wed, 9 Jan 2013 21:51:51 +0000 (13:51 -0800)]
Generate Git patches with "\n" metadata line endings unconditionally

Summary:
Fixes T2175. Git generates patches which have "\n" line endings on every system. We currently generate patches with system-dependent line endings.

Git accepts system-dependent line endings in almost call cases, but part of the parser tests for "\n" explicitly. T2175 has an example of this.

Test Plan:
Ran `arc export --git --revision D4366 > export.git` on a Windows machine, verified "\n" line endings. Ran the same with `--unified`, verified "\r\n" line endings.

(I didn't add any unit tests for this because it's Windows-dependent and very difficult to test meaningfully right now -- i.e., test that appliable patches are generated -- since the git reconstitution test doesn't run on Windows either, because we can't yet untar things there.)

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran
Maniphest Tasks: T2175

Differential Revision: https://secure.phabricator.com/D4373

13 years agoFix checking for flake8 path
vrana [Wed, 9 Jan 2013 21:37:08 +0000 (13:37 -0800)]
Fix checking for flake8 path

Test Plan:
  $ arc unit # without flake8 in path

Reviewers: zeeg

Reviewed By: zeeg

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D4379

13 years agoNormalize Windows directory separators in SVN
epriestley [Wed, 9 Jan 2013 20:34:37 +0000 (12:34 -0800)]
Normalize Windows directory separators in SVN

Summary: Fixes T1946.

Test Plan: Ran `arc diff --only` with added paths inside directories. Saw only "/" entries in the diff.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran, mbishopim3
Maniphest Tasks: T1946

Differential Revision: https://secure.phabricator.com/D4374

13 years agoAllow `arc.bat` to work from paths with spaces in them
epriestley [Wed, 9 Jan 2013 20:34:30 +0000 (12:34 -0800)]
Allow `arc.bat` to work from paths with spaces in them

Summary: If you dump `arcanist/` into "Program Files" or similar, the `.bat` currently breaks. Quote the path so it doesn't. Fixes T1436.

Test Plan: Ran `arc` with `arcanist/` in a path with spaces in it.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1436

Differential Revision: https://secure.phabricator.com/D4375

13 years agoFix `arc diff x y` in SVN
epriestley [Wed, 9 Jan 2013 17:11:26 +0000 (09:11 -0800)]
Fix `arc diff x y` in SVN

Summary:
D4186 added an "svn status --xml x y" form to getSVNStatus(), but the parser doesn't work for multiple files, since we get multiple <target /> elements in the XML output. So, curently, `arc diff` works (one target, all files) and `arc diff x` works (one target, x) but `arc diff x y` does not (more than one target, hits the exception).

  $ arc diff QUACK2 QUACK3
  Exception
  Expected exactly one XML status target.

Test Plan: Ran `arc diff QUACK2 QUACK3` in a working copy with modified QUACK2, QUACK3. Ran `arc diff`; `arc diff QUACK2`.

Reviewers: vrana, btrahan, codeblock, JThramer

Reviewed By: codeblock

CC: aran
Differential Revision: https://secure.phabricator.com/D4372

13 years agoFix "empty diff" error in arcanist
epriestley [Wed, 9 Jan 2013 16:15:53 +0000 (08:15 -0800)]
Fix "empty diff" error in arcanist

Summary: Ref T2296. This error is unreachable right now -- when I fixed all the "\r\n" stuff, we always end up with a nonempty first line for an empty input. Do this test earlier and more explicitly. This results in a less useful error: "expected (some junk) on line 1" instead of "can't parse an empty diff".

Test Plan: Tried to parse an empty diff, got a "you can't parse an empty diff" error.

Reviewers: btrahan, vrana, codeblock

Reviewed By: codeblock

CC: aran
Maniphest Tasks: T2296

Differential Revision: https://secure.phabricator.com/D4370

13 years agoAdd a comma.
Ricky Elrod [Tue, 8 Jan 2013 23:51:32 +0000 (15:51 -0800)]
Add a comma.

Summary: Add a comma because it was going to annoy the crap out of me.

Test Plan: See the comma. :)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4365

13 years agoPass the constructed message to the TYPE_DIFF_DIDBUILDMESSAGE event.
Roy Williams [Tue, 8 Jan 2013 23:06:46 +0000 (15:06 -0800)]
Pass the constructed message to the TYPE_DIFF_DIDBUILDMESSAGE event.

Summary: We want to use TYPE_DIFF_DIDBUILDMESSAGE to abort arc diff when a message doesn't fit some

Test Plan: Created an EventListener subscribed to TYPE_DIFF_DIDBUILDMESSAGE, validated the 'message' field was filled in

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D4361

13 years agoFix cppcheck path finding
Jack Lindamood [Mon, 7 Jan 2013 20:46:49 +0000 (12:46 -0800)]
Fix cppcheck path finding

Summary: This fix lets you run arc lint from any directory in the repository

Test Plan: Ran arc lint from any directory

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4356

13 years agoLimit `arc branch` to 16 concurrent processes
epriestley [Mon, 7 Jan 2013 16:44:55 +0000 (08:44 -0800)]
Limit `arc branch` to 16 concurrent processes

Summary:
Currently, this spawns 125 concurrent processes on my machine, which overflows some limit and gives me an error:

  PHP Warning:  proc_open(): unable to create pipe Too many open files in /INSECURE/devtools/libphutil/src/future/exec/ExecFuture.php on line 491

Instead, limit parallelism to 16. The runtime is approximately the same for me, and dominated by other concerns (conduit calls).

Test Plan: Ran `arc branch` successfully. Ran `arc branch --trace`, observed behavior.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4336

13 years agoCppCheck linter
Jack Lindamood [Mon, 7 Jan 2013 16:16:45 +0000 (08:16 -0800)]
CppCheck linter

Summary:
Lints cpp code using the cppcheck static linter.  This linter needs to
be downloaded and built from http://cppcheck.sourceforge.net/

Test Plan: Used it on a few files.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4353

13 years agoAdd cpplint.py engine
Jack Lindamood [Sat, 5 Jan 2013 02:59:38 +0000 (02:59 +0000)]
Add cpplint.py engine

Summary: Adds arc lint support for cpp files with Google's cpplint.py lint checking.

Test Plan: ran it on some cpp files. Added unit tests

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4344

13 years agomake arc install-certificate <uri> work if uri is specified
Bob Trahan [Thu, 3 Jan 2013 17:23:20 +0000 (09:23 -0800)]
make arc install-certificate <uri> work if uri is specified

Summary: see title

Test Plan: ran arc install-certificate <uri> in a directory without an .arcconfig and it worked! ran arc install-certificate in a directory with an .arcconfig and it worked! ran arc install-certificate <uri> in a directory with an .arcconfig and noted it correctly overrode the .arcconfig

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2251

Differential Revision: https://secure.phabricator.com/D4332

13 years agoCorrect spelling for "arc" commands
epriestley [Mon, 31 Dec 2012 00:01:59 +0000 (16:01 -0800)]
Correct spelling for "arc" commands

Summary:
I type "arc brnach" about 300 times per day.

  - Allow arc commands to be specified by unique prefix ("exp" for "export", "lib" for "liberate").
  - Allow arc commands to be specified by unique levenshtein edit distance <= 2 ("brnach" for "branch", "halp" for "help", "ptach" for "patch").
  - Reorganize code out of "arcanist.php".

I think this will be uncontentious because arc commands are rarely destructive, but if people complain we can either require certain commands be typed exactly (maybe "land"?) or allow this feature to be disabled in configuration.

Test Plan:
  $ arc br
  Usage Exception: Unknown command 'br'. Try 'arc help'.

  Did you mean:
      branch
      browse

  $ arc brnachh
  Usage Exception: Unknown command 'brnachh'. Try 'arc help'.
  $ arc brnach
  (Assuming 'brnach' is the British spelling of 'branch'.)
     doc-security        No Revision      security
     sms                 Needs Revision   D319: Add SMS support to Phabricator
     phxtag              No Revision      derp
     arantag             No Revision      derp
  ...

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4305

13 years agoCorrect description and severity on Flake8 linter
David Cramer [Sat, 22 Dec 2012 00:13:16 +0000 (16:13 -0800)]
Correct description and severity on Flake8 linter

Test Plan: do it live

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4274

13 years agoAdd a flake8 linter
David Cramer [Fri, 21 Dec 2012 23:27:52 +0000 (15:27 -0800)]
Add a flake8 linter

Summary: flake8 is the better maintained combination of pep8 and pyflakes

Test Plan: There's a test!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, jack
Differential Revision: https://secure.phabricator.com/D4082

13 years agoImprove `arc land` recovery from issues with the remote.
epriestley [Fri, 21 Dec 2012 22:18:07 +0000 (14:18 -0800)]
Improve `arc land` recovery from issues with the remote.

Summary:
Fixes T2138.

  - When a pull fails, restore the original branch.
  - When a push fails, complain about it really loudly.

NOTE: No test plan for push yet since I'm not sure this is the right remedy, see T2138 for discsusion.

Test Plan:
  - Tested pull by changing "git pull" to "git xxpull" and running "arc land". Saw the pull fail and my original branch restored.

Reviewers: vrana, aran

Reviewed By: vrana

Maniphest Tasks: T2138

Differential Revision: https://secure.phabricator.com/D4265

13 years agoDon't require clean working copy for `arc diff path` in SVN
vrana [Fri, 14 Dec 2012 23:49:01 +0000 (15:49 -0800)]
Don't require clean working copy for `arc diff path` in SVN

Summary: If you are explicit then there is no need to ask you.

Test Plan:
  $ touch a
  $ arc diff
  $ arc diff a
  $ arc diff existing

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4186

13 years agoUpdate PEP8 to 1.3.4
vrana [Fri, 21 Dec 2012 04:43:39 +0000 (20:43 -0800)]
Update PEP8 to 1.3.4

Summary: Primarily to avoid false positives: http://pypi.python.org/pypi/pep8#id1

Test Plan:
  $ arc lint --engine ComprehensiveLintEngine externals/pep8/pep8.py # after uncommenting externals/ check

Saw 9 errors, haha.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4260

13 years agoSpeed up SVN discovery
vrana [Fri, 21 Dec 2012 02:04:59 +0000 (18:04 -0800)]
Speed up SVN discovery

Summary: `svn info` takes up to 10 seconds.

Test Plan: `arc diff` inside SVN repo and outside any repo.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4256

13 years agoDon't amend commit with the same message in `arc diff`
vrana [Thu, 20 Dec 2012 20:11:57 +0000 (12:11 -0800)]
Don't amend commit with the same message in `arc diff`

Summary: It makes reflog ugly

Test Plan:
# `arc diff`, made error, saw "Message saved to".
# `arc diff`, didn't edit, didn't see "Message saved to".
# `arc diff`, edited, saw "Message saved to".

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4243

13 years agoMake caching lint default
vrana [Thu, 20 Dec 2012 19:35:50 +0000 (11:35 -0800)]
Make caching lint default

Summary: I use it couple of weeks without troubles.

Test Plan:
Added debug output and:

  $ arc lint
  $ arc lint --cache 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2036

Differential Revision: https://secure.phabricator.com/D4242

13 years agoFix `arc diff` in SVN with paths
epriestley [Thu, 20 Dec 2012 19:12:30 +0000 (11:12 -0800)]
Fix `arc diff` in SVN with paths

Summary:
Recently, in D4097 or one of the precursors I refactored this. However, when $rev is null parseBaseCommitArgument() throws ("This VCS does not support commit ranges."). Shield the call so it only happens if if $rev is nonempty (we still want to make the call, so "arc lint --rev x" on SVN will throw and inform the user that "--rev" is incorrect usage).

(@vrana, this was reported by FB and might be worth pushing.)

Test Plan: Ran "arc diff --preview <path>". Grepped for other parseBaseCommitArgument() callsites and verified they don't have similar issues.

Reviewers: vrana, btrahan, chad

Reviewed By: chad

CC: aran
Differential Revision: https://secure.phabricator.com/D4241

13 years agoRefuse writing to undeclared properties in workflows
vrana [Wed, 3 Oct 2012 21:34:02 +0000 (14:34 -0700)]
Refuse writing to undeclared properties in workflows

Summary: I don't know how to not be strict here plus we (Arcanist developers) don't have access to user's error log.

Test Plan:
Undeclared `ArcanistDiffWorkflow::$console`, then:

  $ arc diff

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3607

13 years agoAllow checking out branches in `arc branch`
vrana [Wed, 12 Dec 2012 22:01:26 +0000 (14:01 -0800)]
Allow checking out branches in `arc branch`

Summary:
The main added value is loading the branch name from revision.
Sometimes I know the revision ID but I don't know the branch name.

The missing piece is the starting point of the branch.
I was thinking about using `arc.land.onto.default` but we also need to get 'origin'.

This is also the last step of a simple workflow where underlying VCS is not abstracted away.
In future, we can implement this for other APIs.

Test Plan:
  $ arc branch new_branch
  $ arc branch new_branch
  $ arc branch D4168

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4170

13 years agoMerge pull request #62 from bonneval/bugfixUndefinedVariable
Evan Priestley [Tue, 18 Dec 2012 13:38:05 +0000 (05:38 -0800)]
Merge pull request #62 from bonneval/bugfixUndefinedVariable

Bugfixed undefined variable $commit.

13 years agoBugfixed undefined variable $commit.
bonneval [Tue, 18 Dec 2012 13:31:48 +0000 (14:31 +0100)]
Bugfixed undefined variable $commit.

13 years agoSupport http basic auth and related configuration
Brennan Taylor [Tue, 18 Dec 2012 01:58:53 +0000 (17:58 -0800)]
Support http basic auth and related configuration

This adds the http basic auth username and password if found in the
configuration to the ConduitClient.

Reviewed by: epriestley

13 years agoAllow arc to be run in arcanist/ or libphutil/
epriestley [Tue, 18 Dec 2012 00:35:03 +0000 (16:35 -0800)]
Allow arc to be run in arcanist/ or libphutil/

Summary:
Currently, if you run `arc` in arcanist/ or libphutil/ and your PATH and on-disk configuration are set up so a different version of arc or libphutil are the ones that actually load, we fail with an exception like "running arcanist in a different copy of arcanist is not supported".

This causes problems for Harbormaster, since we'd like to be able to run 'arc' in a copy of libphutil/ and have it execute unit tests for that copy rather than failing abruptly. So, if we detect that we're in arcanist/ or libphutil/, execute 'arc' again with the same arguments but force it to load the working copy in place of either the 'arcanist/' or the 'libphutil/' that it decided to load.

This is pretty much horrible black magic.

Test Plan: Ran 'arc list --trace' inside copies of libphutil/ and arcanist/ outside of the normal include chain. Saw it detect these, emit a message, and re-execute itself correctly.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D4225

13 years agoStop passsing bogus 'user' parameter to differential.createrevision
epriestley [Mon, 17 Dec 2012 22:41:27 +0000 (14:41 -0800)]
Stop passsing bogus 'user' parameter to differential.createrevision

Summary: After D4191 this is a fatal.

Test Plan: Created this revision.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4219

13 years agoImplement --everything, --json and --ugly flags for `arc unit`
epriestley [Mon, 17 Dec 2012 20:56:41 +0000 (12:56 -0800)]
Implement --everything, --json and --ugly flags for `arc unit`

Summary: Adds "arc unit --everything", which runs every available test, provided the test engine supports it. Also add JSON output.

Test Plan: Ran `arc unit --everything` in arcanist/, libphutil/ and phabricator/. Saw all tests run.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran
Maniphest Tasks: T2065

Differential Revision: https://secure.phabricator.com/D4214