]> khamidou — GitHub mirrors - arcanist.git/log
arcanist.git
14 years agoProvide getter for test results properties in `arc diff`
vrana [Fri, 12 Oct 2012 22:21:00 +0000 (15:21 -0700)]
Provide getter for test results properties in `arc diff`

Summary: We want to use them in event.

Test Plan: Will use it in event.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoResolve diff property updates in parallel
vrana [Fri, 12 Oct 2012 22:01:19 +0000 (15:01 -0700)]
Resolve diff property updates in parallel

Summary:
I was thinking about creating a method `differential.setdiffproperties` updating all properties at once or adding 'properties' to `differential.creatediff` (better) but it will require bumping Conduit version.

This looks simpler and with similar effect.
We could postpone resolving properties more but I don't want to risk not resolving them after an error.

Test Plan:
This diff for that it works.
Benchmark: 0.55 s before, 0.25 s after (with three properties, the difference will be bigger with more).

Reviewers: epriestley

Reviewed By: epriestley

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

14 years ago(T1889) arc cover supports Mercurial too
Dereckson [Fri, 12 Oct 2012 14:41:20 +0000 (07:41 -0700)]
(T1889) arc cover supports Mercurial too

Summary: improving documentation: add cover supports Mercurial

Test Plan: ./bin/arc help cover

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1889

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

14 years agoAllow to push revisions to review by himself to Differential (bug T1879, change 2...
Dereckson [Fri, 12 Oct 2012 14:40:53 +0000 (07:40 -0700)]
Allow to push revisions to review by himself to Differential (bug T1879, change 2/2, Arcanist part)

Summary:
The 'review its own revision' check is now handled by Differential (bug T1879)

Previous behavior:
    arc threw an "You can not be a reviewer for your own revision." exception
    if an users adds itself as reviewer, even when this configuration is
    allowed on the Differential remote install's configuration.

New behavior:
    Arc doesn't check that anymore. It still will be checked by the server.

Test Plan: Tested locally pushing revisions with "arc diff" to a Phabricator server with differential.allow-self-accept at true or false with myself or not as reviewer.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1879

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

14 years agoAdded check for no tasks returned by 'arc tasks'
David Reuss [Thu, 11 Oct 2012 19:39:35 +0000 (12:39 -0700)]
Added check for no tasks returned by 'arc tasks'

Test Plan: A lot of spew before. Not so much now.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAdd missing newline in arc export
vrana [Wed, 10 Oct 2012 00:11:41 +0000 (17:11 -0700)]
Add missing newline in arc export

Summary:
Hunk may be missing newline at end of file. It produces exports like this:

  lang=diff
  --- a/third-party
  +++ b/third-party
  @@ -1 +1 @@
  -/mnt/gvfs/third-party/90cb1654197e56261b1733c704b387285f36208e
  \ No newline at end of file
  +/mnt/gvfs/third-party/7097083d10d37251218531da398545658872a47a
  \ No newline at end of filediff --git a/ti/proxygen/TARGETS b/ti/proxygen/TARGETS

Test Plan:
  $ arc export --git --diff 1

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoFix typo in comment
vrana [Tue, 9 Oct 2012 23:39:48 +0000 (16:39 -0700)]
Fix typo in comment

14 years agoWrite to STDERR instead of php://stderr
vrana [Mon, 8 Oct 2012 23:23:49 +0000 (16:23 -0700)]
Write to STDERR instead of php://stderr

Summary: See D3661.

Test Plan:
  $ arc diff --raw

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1261

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

14 years agoDecrease severity of preg_quote() warning
vrana [Fri, 5 Oct 2012 23:32:06 +0000 (16:32 -0700)]
Decrease severity of preg_quote() warning

Summary: I use it more often without second parameter than with it.

Test Plan:
Lint of:

  preg_quote('');
  preg_quote('', '/');

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoRetain newline style when generating diffs
epriestley [Wed, 3 Oct 2012 22:32:03 +0000 (15:32 -0700)]
Retain newline style when generating diffs

Summary: Builds on D3441, D3440. Instead of exploding on "\r?\n" and then imploding on "\n", retain newline style throughout parsing.

Test Plan:
All unit tests pass (the parser has substantial existing coverage). These new tests pass in the git commit-by-commit test case:

  commit 176a4c2c3fd88b2d598ce41a55d9c3958be9fd2d
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:56:08 2012 -0700

      Convert \r\n newlines to \n newlines.

  commit a73b28e139296d23ade768f2346038318b331f94
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:55:31 2012 -0700

      Add text with \r\n newlines.

  commit 337ccec314075a2bdb4a912ef467d35d04a713e4
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:55:13 2012 -0700

      Convert \n newlines to \r\n newlines.

  commit 6d5e64a4a7a6a036c53b1d087184cb2c70099f2c
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:53:39 2012 -0700

      Remove tabs.

  commit 49395994a1a8a06287e40a3b318be4349e8e0288
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:53:33 2012 -0700

      Add tabs.

  commit a5a53c424f3c2a7e85f6aee35e834c8ec5b3dbe3
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:52:57 2012 -0700

      Add trailing newline.

  commit d53dc614090c6c7d6d023e170877d7f611f18f5a
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:52:41 2012 -0700

      Remove trailing newline.

Previously, the newline-related tests failed.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Maniphest Tasks: T866

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

14 years agomake arc commit work on windows with multiline messages
Bob Trahan [Wed, 3 Oct 2012 21:54:43 +0000 (14:54 -0700)]
make arc commit work on windows with multiline messages

Summary: cd && cmd won't work so use chdir; -m $multiline_message won't work so use -F $tmp_file

Test Plan: this is actually un-tested at the moment.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1617

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

14 years agoCorrectly mark patched text in lint console renderer
vrana [Wed, 3 Oct 2012 19:27:33 +0000 (12:27 -0700)]
Correctly mark patched text in lint console renderer

Summary:
Before:
`    >>> -      4 `**1**`* Copyright 2011 Facebook, Inc.`

After:
`    >>> -      4  * Copyright 201`**1**` Facebook, Inc.`

Test Plan: Rendered patchable message, multiline patchable message, unpatchable message.

Reviewers: andrewjcg, epriestley

Reviewed By: epriestley

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

14 years agoImprove handling of `--background` with `--base`
epriestley [Tue, 2 Oct 2012 18:01:49 +0000 (11:01 -0700)]
Improve handling of `--background` with `--base`

Summary:
Currently, we run `runDiffSetupBasics()` //after// splitting off background lint and unit tests. However, this means `--base` and any explicit revision name (like "HEAD^") will not be parsed, so the call to `getRelativeCommit()` in order to generate `arc lint --rev XXX` will fail or not work as expected, because it will ignore any arguments.

Instead, parse `--base`, explicit revisions, and other repository API arguments before doing lint and unit tests.

Test Plan:
  - Set global config for `base` to `arc:amended, git:branch-unique(origin/master)`.
  - Created a commit on master.
  - Ran `arc diff HEAD^`.
    - Before this change, the command fails with "Usage Exception: None of the rules in your 'base' configuration matched a valid commit. Adjust rules or specify which commit you want to use explicitly." when it attempts to run lint, because the `HEAD^` argument is never parsed. After
    - After this change, the command succeeds.

Reviewers: vrana

Reviewed By: vrana

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

14 years agoAmend commit after editing the message in diff
vrana [Fri, 28 Sep 2012 18:49:04 +0000 (11:49 -0700)]
Amend commit after editing the message in diff

Summary:
We store the message to a scratch file.
But if I need to switch context, commit something else and then go back then I'll lose the message.
Amend the repository commit by it instead.
This also removes the annoying question "Do you want to use this message?".

Test Plan: Made an error in message, verified Git log.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoMake `arc tasks` print output in a unicode-aware and console-width-aware way
epriestley [Mon, 1 Oct 2012 02:40:54 +0000 (19:40 -0700)]
Make `arc tasks` print output in a unicode-aware and console-width-aware way

Summary:
Currently, we print `arc tasks` in a console-agnostic and unicode-unaware way, so:

  - Tasks with multibyte characters get aligned incorrectly (see T1831); and
  - narrow terminals plus long task names results in a broken display.

Test Plan: Ran `arc tasks`. Will post screenshots.

Reviewers: btrahan, vrana, Korvin

Reviewed By: btrahan

CC: aran
Maniphest Tasks: T749, T1831

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

14 years agoSearch for more test locations in PHPUnitTestEngine
epriestley [Sun, 30 Sep 2012 01:03:43 +0000 (18:03 -0700)]
Search for more test locations in PHPUnitTestEngine

Summary:
See https://github.com/facebook/arcanist/pull/53

  - Work correctly for directories with `%` in their name; this breaks under sprintf().
  - Search for `src/` -> `tests/` style directories.
  - Add coverage for search paths.

Test Plan:
Ran unit tests.

I don't have a working test case for PHPUnit tests, can one of you guys apply this and verify I didn't break your setups?

Reviewers: quard, aurelijus

Reviewed By: aurelijus

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

14 years agoSearch for SVN commit in Git SVN repository
vrana [Fri, 21 Sep 2012 21:02:27 +0000 (14:02 -0700)]
Search for SVN commit in Git SVN repository

Summary: `arc patch` currently warns about "This diff is against commit svn+ssh://... but the commit is nowhere in the working copy" in Git SVN repository.

Test Plan:
  $ arc patch # in Git SVN repository
  $ svn find-rev r121212112 # invalid revision

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoDelete flushing moved to libphutil
vrana [Fri, 28 Sep 2012 16:45:11 +0000 (09:45 -0700)]
Delete flushing moved to libphutil

Test Plan:
  $ arc diff # under HPHP

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoPatch 'unix:filemode' property as 'svn:executable' in SVN
vrana [Wed, 26 Sep 2012 17:24:10 +0000 (10:24 -0700)]
Patch 'unix:filemode' property as 'svn:executable' in SVN

Summary: Patch created on Git contains 'unix:filemode' property which is useless in SVN.

Test Plan: Exported a bundle changing a file to executable in Git, applied it in SVN, verified that the file is executable.

Reviewers: epriestley

Reviewed By: epriestley

CC: ptarjan, aran, Korvin, digoangeline
Differential Revision: https://secure.phabricator.com/D3554

14 years agoDon't run background process with raw diff source
vrana [Wed, 26 Sep 2012 00:57:01 +0000 (17:57 -0700)]
Don't run background process with raw diff source

Test Plan:
  $ arc diff

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoUnuse $argv in `arc diff --background`
vrana [Mon, 24 Sep 2012 18:32:38 +0000 (11:32 -0700)]
Unuse $argv in `arc diff --background`

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoStep towards working `arc diff --background 1` on Windows
vrana [Fri, 21 Sep 2012 23:29:12 +0000 (16:29 -0700)]
Step towards working `arc diff --background 1` on Windows

Summary:
Running `a.php` from command line doesn't work on Windows, we need to run `php a.php`.
This shouldn't break other OSes.

Test Plan:
  $ arc diff --background 1

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoFlush output before printing lint and unit results in diff
vrana [Fri, 21 Sep 2012 22:27:36 +0000 (15:27 -0700)]
Flush output before printing lint and unit results in diff

Summary:
Under HPHP, output buffer size is ignored.
Flush any buffered output before printing anything from `arc diff` to reduce user's confusion.

Test Plan:
  $ arc diff --preview --background 1
  $ arc diff --preview --background 0

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoMake `arc diff --background 1` default and disable it on Windows
vrana [Tue, 18 Sep 2012 21:14:12 +0000 (14:14 -0700)]
Make `arc diff --background 1` default and disable it on Windows

Summary:
I am using it for about a month.
It works even in Facebook www.

Test Plan:
  $ arc diff --background 1 # hundreds of times

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agofix a bug in ArcanistXHPLinter
Bob Trahan [Fri, 21 Sep 2012 21:59:04 +0000 (14:59 -0700)]
fix a bug in ArcanistXHPLinter

Summary: $param is null here. it should be $node.

Test Plan: arc lint no longer barfed on me!

Reviewers: vrana, epriestley

Reviewed By: vrana

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

14 years agoReformat lint severities for readability
epriestley [Fri, 21 Sep 2012 19:27:32 +0000 (12:27 -0700)]
Reformat lint severities for readability

Summary: See D3482.

Test Plan: `arc lint`

Reviewers: vrana

Reviewed By: vrana

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

14 years agoAdd git-repo-based bundle tests
epriestley [Fri, 21 Sep 2012 19:27:21 +0000 (12:27 -0700)]
Add git-repo-based bundle tests

Summary:
Adds a test which goes through a git repository commit by commit and applies them (in effect) via "arc patch", verifying that the results match the actual commit.

See D3439 for the fixture stuff.

The git repo archive has a couple of trivial commits in it:

  $ ../libphutil/scripts/utils/directory_fixture.php src/parser/__tests__/bundle.git.tgz
  Spawning an interactive shell. Exit when complete.

  sh-3.2$ git log
  commit f19fb9fa1385c01b53bdb6d8842dd154e47151ec
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:30:28 2012 -0700

      Edit a text file.

  commit 228d7be4840313ed805c25c15bba0f7b188af3e6
  Author: epriestley <git@epriestley.com>
  Date:   Wed Sep 5 14:30:11 2012 -0700

      Add a text file.

Test Plan: Ran tests.

Reviewers: edward

Reviewed By: edward

CC: aran
Maniphest Tasks: T866

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

14 years agoHandle empty file add in Git export
vrana [Fri, 21 Sep 2012 17:23:04 +0000 (10:23 -0700)]
Handle empty file add in Git export

Summary: Fixes T1555.

Test Plan: Added empty file, diffed it, exported and patched. Also manually created diff in Differential.

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin
Maniphest Tasks: T1555

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

14 years agoProperly handle file moves in `arc patch` under SVN
vrana [Wed, 19 Sep 2012 22:59:39 +0000 (15:59 -0700)]
Properly handle file moves in `arc patch` under SVN

Summary:
If the file has no changes (probably because it has been moved or copied) then we fail.

Fixes T1708, fixes T1559.

Test Plan:
  $ svn mv a b
  $ arc diff --only
  $ svn revert a b
  $ arc patch --diff # of created diff

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin
Maniphest Tasks: T1559, T1708

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

14 years agoBuild correct corpus in copied or moved files
vrana [Wed, 19 Sep 2012 21:36:38 +0000 (14:36 -0700)]
Build correct corpus in copied or moved files

Summary:
This problem shows very far away.
One of the symptomps is that the contents of a moved file is displayed as added in Differential but it is not a big deal.

The real trouble happens when you try to `arc patch` this diff.
It tries to both copy the file and to add a new contents (which fails).

Fixes T1709.

Test Plan:
  $ git mv a b
  $ git commit -m.
  $ arc diff --only
  $ git reset --hard HEAD^
  $ arc patch --diff # of the created diff

  $ arc unit src/parser/__tests__

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin, boris, mroch, slawekbiel
Maniphest Tasks: T1709

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

14 years agoMark moved binary file as image
vrana [Tue, 18 Sep 2012 22:07:01 +0000 (15:07 -0700)]
Mark moved binary file as image

Test Plan: Moved image, verified that the source file is marked as image: https://secure.phabricator.com/differential/diff/6924/

Reviewers: epriestley, btrahan

Reviewed By: btrahan

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

14 years agoHandle binary file moves in `arc patch` under Git
vrana [Tue, 18 Sep 2012 23:03:32 +0000 (16:03 -0700)]
Handle binary file moves in `arc patch` under Git

Summary: We don't store old file PHID for binary file moves here.

Test Plan: `arc patch` on revision with binary file moves which was failing earlier.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

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

14 years agoRequire PHP 5.3.0 on Windows
vrana [Mon, 17 Sep 2012 20:53:04 +0000 (13:53 -0700)]
Require PHP 5.3.0 on Windows

Test Plan:
  $ arc diff

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoLint functions not available on Windows on PHP 5.2
vrana [Mon, 17 Sep 2012 18:48:41 +0000 (11:48 -0700)]
Lint functions not available on Windows on PHP 5.2

Summary: Also use absolute paths.

Test Plan: Linted Arcanist, libphutil, Phabricator, found no false positives and one real error in [[ https://secure.phabricator.com/diffusion/PHU/browse/master/src/channel/PhutilSocketChannel.php;42d8e8447c8b5d6a$92 | PhutilSocketChannel ]].

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoDeclare ArcanistBaseWorkflow::run()
vrana [Sat, 15 Sep 2012 01:07:18 +0000 (18:07 -0700)]
Declare ArcanistBaseWorkflow::run()

Summary: We call it from `arcanist.php`.

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoHandle `arc diff --background 1 --`
vrana [Sat, 15 Sep 2012 01:46:33 +0000 (18:46 -0700)]
Handle `arc diff --background 1 --`

Summary: We currently insert background parameters to end which causes ignoring them if there is '--'.

Test Plan:
  $ arc diff --background 1 -- HEAD^

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoFix typo in comment
vrana [Sat, 15 Sep 2012 00:52:24 +0000 (17:52 -0700)]
Fix typo in comment

14 years agoPublicize formatting unit test result
vrana [Thu, 13 Sep 2012 20:25:26 +0000 (13:25 -0700)]
Publicize formatting unit test result

Summary: I want to use it from outside.

Test Plan:
  $ arc unit src/lint/linter/__tests__/

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoUse array_mergev() in Phutil test engine
vrana [Thu, 13 Sep 2012 20:07:27 +0000 (13:07 -0700)]
Use array_mergev() in Phutil test engine

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoMerge pull request #52 from killme2008/master
Evan Priestley [Thu, 13 Sep 2012 23:35:16 +0000 (16:35 -0700)]
Merge pull request #52 from killme2008/master

Fixed git branch name contains color

14 years agoGet branch name with --no-color option
dennis zhuang [Thu, 13 Sep 2012 22:12:19 +0000 (15:12 -0700)]
Get branch name with --no-color option

14 years agoLint short ternary as PHP 5.3 feature
vrana [Thu, 13 Sep 2012 18:19:25 +0000 (11:19 -0700)]
Lint short ternary as PHP 5.3 feature

Summary: I don't offer a replacement because `f() ?: 1` converted to `f() ? f() : 1` can cause side effects and whitespace issues.

Test Plan: New test.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoSkip linter tests with usage problems
vrana [Wed, 12 Sep 2012 17:39:39 +0000 (10:39 -0700)]
Skip linter tests with usage problems

Summary: D3480#comment-1

Test Plan: This diff.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAdd missing space in string
vrana [Wed, 12 Sep 2012 17:42:36 +0000 (10:42 -0700)]
Add missing space in string

14 years agoTweak severity of pht() linter
vrana [Wed, 12 Sep 2012 17:17:59 +0000 (10:17 -0700)]
Tweak severity of pht() linter

Summary:
`pht()` can be some random function.
Better solution would be to separate this linter to its own class but it would be slower.

Also use `PhutilLintEngine` as `lint.engine`.

Test Plan:
  $ arc lint # on file with pht($a)

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoFix typo in comment
vrana [Wed, 12 Sep 2012 09:11:22 +0000 (02:11 -0700)]
Fix typo in comment

14 years agoMake `ruby -wc` a linter in Arcanist
Leah Xue [Thu, 6 Sep 2012 18:50:15 +0000 (11:50 -0700)]
Make `ruby -wc` a linter in Arcanist

Summary: Add `ruby -wc` as a linter and raise Error whenever there's a syntax error

Test Plan: Just a few dumb unit tests.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoMake spell check linter patching
vrana [Mon, 10 Sep 2012 23:09:44 +0000 (16:09 -0700)]
Make spell check linter patching

Test Plan:
Wrote "Posible" in the linter, let it change to "Possible".
New unit test.

Reviewers: jack, epriestley

Reviewed By: epriestley

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

14 years agoFix false negatives in "break;" lint check
epriestley [Sat, 8 Sep 2012 00:46:35 +0000 (17:46 -0700)]
Fix false negatives in "break;" lint check

Summary: See D3449, comments, unit tests.

Test Plan: Unit tests.

Reviewers: vrana

Reviewed By: vrana

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

14 years agoAdd a test case for false negative switch lint rule
vrana [Thu, 6 Sep 2012 22:13:18 +0000 (15:13 -0700)]
Add a test case for false negative switch lint rule

Summary:
I tried to fixed it but I've given up.

See rP958e6cd109f3.

Test Plan:
  $ arc unit

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAllow Phutil tests setting link
vrana [Fri, 7 Sep 2012 21:18:55 +0000 (14:18 -0700)]
Allow Phutil tests setting link

Summary: Also delete some copy pasta.

Test Plan: Next diff.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoLink Arcanist test cases
vrana [Fri, 7 Sep 2012 22:16:39 +0000 (15:16 -0700)]
Link Arcanist test cases

Summary: See D3455.

Test Plan: This diff (after rebase).

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoUse /usr/bin/env python
Peter Ruibal [Fri, 7 Sep 2012 02:03:42 +0000 (19:03 -0700)]
Use /usr/bin/env python

Summary: Use python from env, instead of the distro installed one in /usr/bin

Test Plan:
Ran arc anoid on a system that only had python in /usr/bin, still
works. Ran arc anoid on a system that had a python in /usr/local/bin before
/usr/bin.  Still works as well

Reviewers: epriestley, alanh

Reviewed By: epriestley

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

14 years agoSupport linking unit tests
vrana [Fri, 7 Sep 2012 01:44:15 +0000 (18:44 -0700)]
Support linking unit tests

Summary: This is Arcanist part of D3434.

Test Plan: None.

Reviewers: epriestley, wez

Reviewed By: epriestley

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

14 years agoMerge pull request #51 from bpedman/master
Evan Priestley [Thu, 6 Sep 2012 16:40:22 +0000 (09:40 -0700)]
Merge pull request #51 from bpedman/master

Fix getCommitMessage to properly separate subject and body with 2 newlines

14 years agoFix commit message format returned by getCommitMessage
Brandon Pedersen [Thu, 6 Sep 2012 14:56:44 +0000 (08:56 -0600)]
Fix commit message format returned by getCommitMessage

Git commit messages must have 2 newlines between the subject and body
If used to rewrite a commit message then the commit message will be
incorrectly reformatted.

14 years agoImplement the arcanist top-level log handling in terms of $console->writeLog()
epriestley [Wed, 5 Sep 2012 18:45:54 +0000 (11:45 -0700)]
Implement the arcanist top-level log handling in terms of $console->writeLog()

Summary:
  - See D3422.
  - Also improve some event configuration/debugging stuff.

Test Plan: Ran `arc list --trace`, set bogus/valid event handlers.

Reviewers: vrana, nh

Reviewed By: vrana

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

14 years agoUse punctuation in spelling linter
vrana [Wed, 5 Sep 2012 06:45:54 +0000 (23:45 -0700)]
Use punctuation in spelling linter

Summary: Also move dependency one directory down.

Test Plan:
  $ arc lint # on file with "teh"

Reviewers: jack, epriestley

Reviewed By: epriestley

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

14 years agoDelete obsolete comment
vrana [Wed, 5 Sep 2012 04:21:30 +0000 (21:21 -0700)]
Delete obsolete comment

Summary:
HPHP now autoloads in `is_subclass_of()`.
I've left the `class_exists()` check as the code is more explicit.

Test Plan:
  // under HPHP
  function __autoload($c) {
    echo "$c\n";
  }
  is_subclass_of('C', 'stdClass');

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAlways include 'workflow' on Arcanist events
epriestley [Tue, 4 Sep 2012 19:08:04 +0000 (12:08 -0700)]
Always include 'workflow' on Arcanist events

Summary:
This object is highly useful in many client event handlers (particularly for access to the CLI) and allows them to be implemented less intrusively.

This also slightly reduces code duplication.

Test Plan: Ran "arc diff".

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1753

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

14 years ago[hg - arc patch] make mercurial bookmark with arc patch
katherine [Sat, 18 Aug 2012 18:23:56 +0000 (11:23 -0700)]
[hg - arc patch] make mercurial bookmark with arc patch

Summary:
w00t!

Created new functions getBookmarkName, createBookmark that use mercurial
commands to create a new bookmark and apply the commit message when
running arc patch. Like with git, it checks if the bookmark already
exists. If it does, creates arcpatch-DXXX-1, -2 etc

Updated the mercurial section of run() to include applying the commit
message.

Pretty new to programming in general still, so I wasn't sure if I should
have just modified getBranchName and createBranch to work with Mercurial
(instead of creating new functions). This was easier for me to make sure
I didn't break the git functionality. Let me know I can merge the
functions.

Test Plan:
Tested in my www-hg repository. Probably need to test further (suggestions?)

Ran the following trials with arc patch D539987
1) the bookmark arcpatch-D539987 already existed
2) the bookmark did not exist
3) tried an invalid commit, arc patch R539987
4) --nobookmark flag (bookmark was not created, but the commit applied)
5) --nocommit flag (boomark was created, and the commit was not applied)
6) --nocommit and --nobokmark

Here's the summary of the results:
https://secure.phabricator.com/P493

Reviewers: dschleimer

Reviewed By: dschleimer

CC: aran, epriestley, phleet, bos, csilvers
Differential Revision: https://secure.phabricator.com/D3334

14 years agoAdd a `willCreateRevision` event
epriestley [Thu, 30 Aug 2012 19:28:35 +0000 (12:28 -0700)]
Add a `willCreateRevision` event

Summary:
Adds an event prior to creation of a new revision so installs can muck around with titles, etc.

I'll also update the docs.

Test Plan: Ran "arc diff --trace" and observed event dispatch. Added `var_dump()` and verified $revision is a reasonable object.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, geoffberger
Differential Revision: https://secure.phabricator.com/D3408

14 years agoUse paste.query for arc paste
Nick Harper [Wed, 29 Aug 2012 18:04:19 +0000 (11:04 -0700)]
Use paste.query for arc paste

Summary: paste.info is deprecated; switch to using paste.query

Test Plan:
  arc paste P123
  arc paste P123 --json

Reviewers: epriestley, vrana

Reviewed By: epriestley

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

14 years agoDispatch event after building diff message
vrana [Tue, 28 Aug 2012 01:21:49 +0000 (18:21 -0700)]
Dispatch event after building diff message

Summary:
We log time of running `arc diff`. It's easy with `--verbatim` or with users just confirming the message built in commit template.

With `--background`, I want to log only waiting time, not message editing time. This event should allow it.

Test Plan:
  $ arc diff

Haven't created the listener yet.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoMinor, fix obvious typo in SVN patch workflow (@mroch).
epriestley [Fri, 24 Aug 2012 00:52:38 +0000 (17:52 -0700)]
Minor, fix obvious typo in SVN patch workflow (@mroch).

14 years agoCreate v2 libraries
vrana [Wed, 22 Aug 2012 22:27:13 +0000 (15:27 -0700)]
Create v2 libraries

Summary:
This is how it looks like now:

>     What do you want to name this library? x
> Writing '__phutil_library_init__.php' to 'x/__phutil_library_init__.php'...
> Usage Exception: This library is using libphutil v1, which is no longer supported. Run 'arc liberate --upgrade' to upgrade to v2.

Test Plan:
  $ arc liberate # in new dir

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAlways use lint advices
vrana [Wed, 22 Aug 2012 18:07:41 +0000 (11:07 -0700)]
Always use lint advices

Summary:
We want to have a class of lint problems which are displayed to author and attached to revision but don't require excuse in diff workflow.
Lint advices already serve this purpose but no linters emit them because they need `--advice` flag to be processed.

By always enabling advices, we can switch more linters from warnings to advices and don't stop the diff workflow for them.

This diff also bumps down default severity of TODO rule.

Test Plan: Made lint advice mistake, ran `arc lint`.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoImprove management of zlib dependency
epriestley [Tue, 21 Aug 2012 00:26:42 +0000 (17:26 -0700)]
Improve management of zlib dependency

Summary:
  - Add zlib functions to extension functions.
  - Provide a better error if the extension is actually missing.

Test Plan: Eyeballed it.

Reviewers: vrana, btrahan

Reviewed By: btrahan

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

14 years agoLink docs from message
vrana [Thu, 16 Aug 2012 21:27:35 +0000 (14:27 -0700)]
Link docs from message

Test Plan:
  phutil_console_confirm("See http://www.phabricator.com/docs/phabricator/article/Differential_User_Guide_Large_Changes.html for information");

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoUse console in unit inside diff
vrana [Wed, 15 Aug 2012 22:54:34 +0000 (15:54 -0700)]
Use console in unit inside diff

14 years agoDon't ask for confirmation with unsound unit tests
vrana [Mon, 16 Jul 2012 22:54:11 +0000 (15:54 -0700)]
Don't ask for confirmation with unsound unit tests

Test Plan:
  $ arc diff # with unsound tests
  $ arc diff --ignore-unsound-tests # with unsound tests

Reviewers: epriestley, aran

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1515

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

14 years agoFix lint warning
vrana [Wed, 15 Aug 2012 21:27:01 +0000 (14:27 -0700)]
Fix lint warning

14 years agoWarn about strstr() misuse
vrana [Wed, 15 Aug 2012 20:30:40 +0000 (13:30 -0700)]
Warn about strstr() misuse

Summary: See D3296#1.

Test Plan:
New test.
Linted Arcanist, libphutil, Phabricator repositories, found no false positive and one real positive.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoWarn before using `strpos($a, $b) === 0`
vrana [Wed, 15 Aug 2012 19:56:36 +0000 (12:56 -0700)]
Warn before using `strpos($a, $b) === 0`

Summary:
I'm not sure if we are interested in this kind of linters ("Don't use slow function if there is a fast alternative").
I didn't find a case where `strpos() === 0` could be useful except [[ http://www.php.net/manual/en/mbstring.overload.php | mbstring.func_overload ]] craziness.

Test Plan:
New unit test.
Linted Arcanist, libphutil, Phabricator repositories, found no false positive and one real positive.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

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

14 years agoAdd extraData field to test results
Wez Furlong [Wed, 15 Aug 2012 17:34:29 +0000 (10:34 -0700)]
Add extraData field to test results

Summary:
See discussion on T1630.
extraData provides more scope for extensions to piggy-back
more data on the test results and have that pulled up to the UI.

We're using keys like "facebook:complexity" to store additional
data as part of the test results.

Test Plan:
Nothing in the codebase touches extraData at the moment, so
you'll just have to have faith/prove by inspection.

Reviewers: vrana, nh, tuomaspelkonen, epriestley

Reviewed By: epriestley

CC: aran, epriestley
Maniphest Tasks: T1630

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

14 years agoDetect use of f()[0] in lint
epriestley [Wed, 15 Aug 2012 11:36:50 +0000 (04:36 -0700)]
Detect use of f()[0] in lint

Summary: XHPAST doesn't currently parse most PHP 5.4 stuff, but it does parse this. Warn about it.

Test Plan:
Unit tests, and:

   Error  (XHP35) Use Of PHP 5.4 Features
    The f()[...] syntax was not introduced until PHP 5.4, but this codebase
    targets an earlier version of PHP. You can rewrite this expression using
    idx().

             365   public function lintPHP54Features($root) {
             366
             367     if (false) {
    >>>      368       id()[0];
                            ^
             369     }
             370

Reviewers: alanh, vrana

Reviewed By: alanh

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

14 years agoPass lint and unit results to diff created event
vrana [Mon, 13 Aug 2012 19:20:34 +0000 (12:20 -0700)]
Pass lint and unit results to diff created event

Summary:
I need to run some jobs only if the tests hasn't been skipped.
I know that this could end up by passing more and more data to the event but this is all I need so far.

Test Plan: Dumped `unitResult` from the listener.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoImplement base85 in a 32-bit safe way, without bcmath
epriestley [Mon, 13 Aug 2012 02:21:33 +0000 (19:21 -0700)]
Implement base85 in a 32-bit safe way, without bcmath

Summary: See T1635 and the giant inline comment.

Test Plan: Ran unit tests on 32-bit and 64-bit machines.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran
Maniphest Tasks: T1635

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

14 years agoAdd test coverage to the base85 implementation
epriestley [Mon, 13 Aug 2012 02:20:46 +0000 (19:20 -0700)]
Add test coverage to the base85 implementation

Summary: See T1635. I'm going to make an effort to rewrite this in a way that's safe in 32-bit PHP, i.e. without bcmath. Add test coverage to limit the chance I screw it up.

Test Plan: Ran unit tests.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran
Maniphest Tasks: T1635

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

14 years agoSwitch arcanist to phutil_utf8_convert()
epriestley [Sun, 12 Aug 2012 15:50:01 +0000 (08:50 -0700)]
Switch arcanist to phutil_utf8_convert()

Summary: See D3252. Reduces code duplication a little bit. Also remove some dire warnings about impending doom -- this has been in use in the wild for a long time.

Test Plan: Added a file in ISO-8859-1, ran `arc diff --encoding ISO-8859-1` to generate this revision, got an encoding note in output.

Reviewers: davidreuss, vrana, btrahan

Reviewed By: davidreuss

CC: aran
Maniphest Tasks: T452

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

14 years agoRaise exception instead of returning magical number from 'arc anoid'
epriestley [Fri, 10 Aug 2012 22:29:27 +0000 (15:29 -0700)]
Raise exception instead of returning magical number from 'arc anoid'

Summary: how do I python

Test Plan: help

Reviewers: alanh

Reviewed By: alanh

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

14 years agoFix serious problems with 'arc anoid'
epriestley [Fri, 10 Aug 2012 22:16:02 +0000 (15:16 -0700)]
Fix serious problems with 'arc anoid'

Summary: https://github.com/facebook/arcanist/issues/48

Test Plan: hmm

Reviewers: alanh, tuomaspelkonen

Reviewed By: tuomaspelkonen

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

14 years agoAllow arcanist to search for libphutil in externals/includes/
epriestley [Fri, 10 Aug 2012 21:58:19 +0000 (14:58 -0700)]
Allow arcanist to search for libphutil in externals/includes/

Summary:
In some cases (notably, homebrew) an installer may not control where arcanist/ and libphutil/ live and may not be able to control 'include_path'.

Allow libphutil/ to be symlinked into arcanist/externals/includes/ if all else fails.

Test Plan:
  - Moved `libphutil` to `libphutilx`. Ran "arc" and got a failure.
  - Symlinked it into externals/includes/, ran `arc`, got success.
  - Moved it back to `libphutil`, ran `arc`, success.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, tfmeusburger
Differential Revision: https://secure.phabricator.com/D3243

14 years agoFix doc links
vrana [Fri, 10 Aug 2012 21:15:15 +0000 (14:15 -0700)]
Fix doc links

Summary: I will also commit fixes in other repos.

Test Plan: LinkChecker

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoRemove `beginRedirectOut()` from Arcanist
epriestley [Fri, 10 Aug 2012 19:10:09 +0000 (12:10 -0700)]
Remove `beginRedirectOut()` from Arcanist

Summary: We always do this on --recon now, see D3213.

Test Plan: Ran `arc diff --background 1` to generate this diff.

Reviewers: vrana

Reviewed By: vrana

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

14 years agoMake the "this is technical documentation" message of "Arcanist Overview" more clear
epriestley [Fri, 10 Aug 2012 18:37:30 +0000 (11:37 -0700)]
Make the "this is technical documentation" message of "Arcanist Overview" more clear

Summary:
The only purpose of "Arcanist Overview" is to tell people they shouldn't be here, but we bury the lede.

Make it clear that this is not user documentation.

After T988 we can improve the organization here, but some recent users found this pretty confusing.

Test Plan: Generated and read documentation.

Reviewers: vrana, btrahan

Reviewed By: vrana

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

14 years agoImprove "arc patch" error messages for mismatched local and diff
epriestley [Fri, 10 Aug 2012 01:39:41 +0000 (18:39 -0700)]
Improve "arc patch" error messages for mismatched local and diff

Summary: We emit a confusing error if there's no ".arcconfig" in the local right now.

Test Plan:
  $ arc patch D3185

    This patch is for the 'phabricator' project,  but the working copy
    belongs to the 'phabricatox' project. Still try to apply the patch? [Y/n]

  $ arc patch D3185

    This patch is for the 'phabricator' project, but the working copy does
    not have an '.arcconfig' file to identify which project it belongs to.
    Still try to apply the patch? [Y/n]

Reviewers: vrana, btrahan

Reviewed By: vrana

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

14 years agoAllow specifying root in `arc inlines`
vrana [Fri, 10 Aug 2012 00:37:47 +0000 (17:37 -0700)]
Allow specifying root in `arc inlines`

Summary: Simplifies editor bindings.

Test Plan:
  $ arc inlines --root W:/devtools/phabricator/

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoRedirect output to console in background mode of `arc diff`
vrana [Thu, 9 Aug 2012 02:02:33 +0000 (19:02 -0700)]
Redirect output to console in background mode of `arc diff`

Summary: See D3208.

Test Plan:
  $ arc diff --background 1

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoFix an issue where 'arc alias' reverses parameters
epriestley [Wed, 8 Aug 2012 19:58:27 +0000 (12:58 -0700)]
Fix an issue where 'arc alias' reverses parameters

Summary:
We shove alias parameters onto the front of the arg list so if you make an alias like "qdiff" = "diff x y z" and then run "qdiff a b c", we end up with "diff x y z a b c". However, currently we reverse alias parameters, so you actually get "diff z y x a b c".

This is a problem for `arc alias bdiff -- diff --background 1`, which evaluates to `arc diff 1 --background` and fails.

Test Plan: Created a `bdiff` alias and ran it successfully.

Reviewers: vrana, btrahan

Reviewed By: btrahan

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

14 years agoRun lint and unit before updating revision
vrana [Wed, 8 Aug 2012 19:08:41 +0000 (12:08 -0700)]
Run lint and unit before updating revision

Summary: Depends on D2614.

Test Plan:
Updated a diff with no lint errors.
Updated a diff with lint errors, verified that the previous message is not lost.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoRun lint and unit tests in `arc diff` on background
vrana [Mon, 6 Aug 2012 20:40:20 +0000 (13:40 -0700)]
Run lint and unit tests in `arc diff` on background

Summary:
I usually write commit messages 1-2 minutes.
`arc lint` in our repository usually runs for around 30 seconds, `arc unit` another minute or two.
Even Phabricator unit tests sometimes runs long (because `CREATE DATABASE` and `DROP DATABASE` is slow in our setup for some reason).

Waiting for the results is boring and unnecessary.

This diff presents two different concepts how to run them on background:

# Lint is run with `--output json`, results are parsed and presented back to user. It isn't perfect - there's no context in printed lint errors which is a serious problem.
# Unit tests are run normally and the results are written to a scratch file. It also isn't perfect - colors are lost during the process.

I'll probably choose one approach and use it on both places. Let me know your thoughts about them.

This can be further improved to resolve the futures also after inputting the update message but it can be done in a separate diff.

Test Plan:
- Remove lint engine.
- Remove unit engine.
- Make lint errors.
- Make unit errors.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, beng, tuomaspelkonen, alanh
Differential Revision: https://secure.phabricator.com/D2614

14 years agoDepend on events when attaching Diff ID to postponed unit tests
vrana [Mon, 6 Aug 2012 23:56:11 +0000 (16:56 -0700)]
Depend on events when attaching Diff ID to postponed unit tests

Summary:
According to @epriestley, it's nasty and kind of crazy: D2933#1.
It also stands in my way for D2614.

Test Plan: Rewrote our callsite to event listener and verified that it still works.

Reviewers: tuomaspelkonen, epriestley

Reviewed By: epriestley

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

14 years agoFix an issue where branches at the same commit race to destruction in "arc branch"
epriestley [Wed, 8 Aug 2012 01:21:32 +0000 (18:21 -0700)]
Fix an issue where branches at the same commit race to destruction in "arc branch"

Summary:
If two branches have the same HEAD, they currently race to overwrite each other in $commit_map.

We don't need to return a map indexed by commit since nothing ever reads the keys out of it. Just update $branches in place.

Test Plan: With two branches at the same HEAD, ran "arc branch". Saw both branches in output.

Reviewers: vrana, btrahan

Reviewed By: btrahan

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

14 years agoThrow properly if there are uncommitted changes under Git
epriestley [Mon, 6 Aug 2012 18:56:01 +0000 (11:56 -0700)]
Throw properly if there are uncommitted changes under Git

Summary: This was accidentally disabled with some Mercurial changes that allowed dirty working copies.

Test Plan: Ran `arc diff` with staged changes.

Reviewers: nh

Reviewed By: nh

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

14 years agoUse PhutilConsole in lint and unit
vrana [Sun, 5 Aug 2012 02:23:53 +0000 (19:23 -0700)]
Use PhutilConsole in lint and unit

Test Plan:
`arc lint` with OK result and with patchable error.
`arc unit` with passes and errors.
`arc diff` with patchable lint error.

Reviewers: epriestley

Reviewed By: epriestley

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

14 years agoAdd an arc flag workflow
Alan Huang [Fri, 3 Aug 2012 19:00:54 +0000 (12:00 -0700)]
Add an arc flag workflow

Summary:
Allow querying and modifying flags from arcanist. Currently
supports only printing and deleting flags for Differential revisions,
but it should be straightforward to add more capabilities (given Conduit
support).

Test Plan:
Run arc flag, passing it various revisions. Flags are
modified appropriately.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1556

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

14 years agoAdd mysql and mysqli functions to the phutil map whitelist
epriestley [Wed, 1 Aug 2012 18:02:20 +0000 (11:02 -0700)]
Add mysql and mysqli functions to the phutil map whitelist

Summary: I originally excluded `mysql` these under the theory that it would be impossible to test anything without it, but `arc` doesn't need it and you could have only one of the mysql-flavored extensions without having the other one. Whitelist all the mysql and mysqli extension functions as far as depenencies are concerned.

Test Plan: @floatinglomas, let me know if this fixes things for you?

Reviewers: btrahan, vrana, floatinglomas

Reviewed By: btrahan

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

14 years agoMerge pull request #47 from aurelijus/master
Evan Priestley [Mon, 30 Jul 2012 11:54:21 +0000 (04:54 -0700)]
Merge pull request #47 from aurelijus/master

JSHint linter issue on windows

14 years agoJSHint linter issue on windows
Aurelijus [Mon, 30 Jul 2012 07:21:03 +0000 (09:21 +0200)]
JSHint linter issue on windows

Summary: On windows there is no 'which', only 'where'

Test Plan: Run JSHint linter on windows and unix-like system.

Reviewers: epriestley

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