1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-21 01:18:50 +02:00
Commit graph

494 commits

Author SHA1 Message Date
epriestley
ccdf9ae957 Bump Conduit client version
Summary:
Several related changes:

  - Add a "--conduit-version" flag, so you can actually diff conduit version bumps. Otherwise, the server rejects you.
  - Make "arc upgrade" upgrade both libphutil and arcanist, not just arcanist.
  - Bump the version number to 5. See D2527.

Test Plan:
  - Ran "arc upgrade".
  - Ran "arc diff". Got told there was a version issue.
  - Ran "arc diff --conduit-version=4" to create this diff.

Reviewers: indiefan, nh, vrana, btrahan, jungejason, Makinde

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2528
2012-05-21 16:45:03 -07:00
epriestley
3e655e7d4c Dispatch a "diff.willBuildMessage" event from Arcanist
Summary:
Hive has custom integration which relies on prefilling a bunch of information from JIRA. This is currently broken and accomplished in a roundabout way. Instead, add an event that the integration can listen for. See next diff.

@Girish, I guess you're official Phabricator/Hive support now?

Test Plan: Ran the Hive/JIRA workflows in Git and SVN, see next diff.

Reviewers: Girish, btrahan, ashutoshc

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1206

Differential Revision: https://secure.phabricator.com/D2449
2012-05-20 16:39:38 -07:00
vrana
d23d2df7e1 Say until when the reviewers are away
Test Plan: `arc diff` with reviewers away.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2496
2012-05-19 13:11:54 -07:00
vrana
a5c6f32a06 Warn user about specifying reviewers that are away
Summary:
There are different options how to implement this:
We can also generate the warning in `validateField()` and handle it in all callsites.
This is sufficient for me and simple enough.

Test Plan: `arc diff` revision with reviewer away/not away.

Reviewers: btrahan, jungejason

Reviewed By: jungejason

CC: epriestley, aran

Differential Revision: https://secure.phabricator.com/D2493
2012-05-18 00:04:29 -07:00
Jamie Wong
92819458b8 Make arc diff work with multiple heads in hg 2012-05-17 13:07:53 -04:00
Jamie Wong
b8fb074dcf Make arc diff not crash on hg bookmarks 2012-05-16 13:24:30 -04:00
Nick Harper
032b9b30b0 Provide user-friendly error in arc diff --update
Summary:
If you forget to provide an argument for --update and have another argument
following it (e.g. HEAD^), we should provide a nice error message instead
of passing that argument through to a conduit call and then printing the
conduit error.

Test Plan: ran 'arc diff --update HEAD^' and got a nice error message

Reviewers: epriestley, jungejason, vrana

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2468
2012-05-11 19:10:20 -07:00
epriestley
a31fc544c8 Fix "local commits" for Git and Mercurial to align with user expectations, and fix a parsing bug
Summary:
  - "git log" still includes "\n", so we're currently generating nonsense hashes like "\nabd9879bab86ad78ab...".
  - Correct the log range we use in Git. See comment. When users perform merges, their expectations about what the "included commits" and what the included changes are are different. Represent them with two different ranges.
  - Same deal for Mercurial

Test Plan: Ran "arc which" in various contexts.

Reviewers: btrahan, aurelijus, Makinde

Reviewed By: Makinde

CC: aran, nh, jungejason

Maniphest Tasks: T873

Differential Revision: https://secure.phabricator.com/D2460
2012-05-11 13:52:14 -07:00
epriestley
e50ea62271 Make "arc which" really really really verbose
Summary: Provide far more information about what "arc diff" intends to do.

Test Plan: Ran "arc which" in a variety of circumstances.

Reviewers: btrahan, Makinde

Reviewed By: Makinde

CC: aran

Maniphest Tasks: T1183

Differential Revision: https://secure.phabricator.com/D2454
2012-05-11 06:07:33 -07:00
Nick Harper
97262085b7 Remove arc export's dependency on a working copy when using --diff
Summary:
When getting an encoding, we should query the server for the encoding of the
project that we're exporting from, not the project that we're running arc in
(arc might not be in a working copy).

Test Plan: ran arc export with --diff and didn't get a workflow exception

Reviewers: epriestley, jungejason, vrana, davidreuss

Reviewed By: jungejason

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2455
2012-05-10 17:44:42 -07:00
epriestley
86ead1b8f1 arc land: add --delete-remote, raise an error for landing a branch onto itself
Summary:
  - Allow users to delete the remote copy of a feature branch as well as the local one, for workflows that push feature branches. We test if the remote exists before trying to delete it.
  - Raise a better warning when you misuse "arc land".
  - I also wrote some documentation about this, see next diff.

Test Plan:
  - Tried to land a branch onto itself.
  - Ran "arc land --delete-remote" on feature branches with and without remote feature branches.

Reviewers: aurelijus, btrahan

Reviewed By: aurelijus

CC: aran

Maniphest Tasks: T1204

Differential Revision: https://secure.phabricator.com/D2445
2012-05-10 12:14:53 -07:00
epriestley
9d5c5f6310 Fix 'rev' index error for Mercurial
Summary: I renamed this in D2437 for greater consistency with everything else, but missed this use of the old key.

Test Plan: idk lmk?

Reviewers: Makinde

Reviewed By: Makinde

CC: aran

Differential Revision: https://secure.phabricator.com/D2452
2012-05-10 11:43:21 -07:00
epriestley
53161a1b84 Ship complete commit messages to Phabricator from Arcanist
Summary: Currently, we ship only the summary, but we need to ship the whole thing for T1189.

Test Plan: Added var_dump() + die, ran in git and hg working copies, verified 'message' included the whole message.

Reviewers: csilvers, btrahan, Makinde

Reviewed By: csilvers

CC: aran

Maniphest Tasks: T1189

Differential Revision: https://secure.phabricator.com/D2437
2012-05-09 15:56:16 -07:00
epriestley
19aa759f39 "arc upgrade", to automatically upgrade arc (client changes)
Summary:
  - Try to limit the pain of //future// version bumps by making arc self-updating.
  - When the server needs a newer version, prompt the user to update.
  - (We need them to reissue their command because we may already have loaded classes which have changed in the update.)
  - Make the message sound exciting!

Test Plan: Artifically bumped server forward, ran "arc list", got to upgrade!

Reviewers: Makinde, nh, jungejason, btrahan

Reviewed By: nh

CC: aran

Differential Revision: https://secure.phabricator.com/D2435
2012-05-09 10:01:31 -07:00
Nick Harper
b34915020e Catch ArcanistUsageException when getting git parent log info
Summary:
ArcanistDiffWorkflow::getGitParentLogInfo() calls
ArcanistDifferentialCommitMessage::newFromRawCorpus() which may throw a
ArcanistUsageException if the parent commit message is malformed (specifically,
a bad "Differential Revision:" line); this should not stop arc diff.

Test Plan: successfully ran arc diff where the parent commit message was malformed.

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2434
2012-05-08 17:32:54 -07:00
Nick Harper
b8b4082efd Allow --verbatim and -m in arc diff
Summary:
There's no reason these should be exclusive: -m is used only on update for the
update message, and --verbatim doesn't affect the udpate message. It's also
useful to allow both of these, if say I want to update my test plan by editing
my git commit message and also provide a message for the update from the
command line.

Test Plan:
ran arc diff with --verbatim and -m and saw my message from -m was used, as
well as my updates in the commit message went through.

Reviewers: jungejason, epriestley, vrana

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2426
2012-05-07 17:32:21 -07:00
epriestley
5c684594d4 Allow 'arc' to run without '.arcconfig'
Summary:
This is mostly an onboarding thing, but also allows "arc upload", "arc download", and "arc paste" to work anywhere on the system.

  - Try to read the Phabricator install URI from arc global config if we can't find ".arcconfig".
  - Build a WorkingCopy anyway if we can't find ".arcconfig", as long as we can find ".svn", ".git", or ".hg".
  - Make all the workflows handle "no project ID" at least somewhat gracefully.

Test Plan:
  - Ran "arc diff" in .arcconfig-less Mercurial, Git, and Subversion working copies.
  - Ran "arc upload" and "arc download" from my desktop.
  - Ran "arc paste" from somewhere random.
  - Cleared my config and hit the error, got useful instructions.

Reviewers: btrahan, csilvers

Reviewed By: csilvers

CC: aran

Differential Revision: https://secure.phabricator.com/D2424
2012-05-07 15:24:58 -07:00
epriestley
9063cfbdba Provide more context in "arc diff" messages in Git
Summary: These are the unambiguously-good changes from D2388. Show commits included in a revision in the editor in "arc diff".

Test Plan: Ran "arc diff", saw which commits were being included.

Reviewers: nh, jungejason, vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1183

Differential Revision: https://secure.phabricator.com/D2406
2012-05-07 13:18:16 -07:00
Nick Harper
6fcd2db646 Always use git.default-relative-commit, if present
Summary:
Always use the value in git.default-relative-commit when getting the relative
commit in git.

Test Plan:
Ran arc diff in a repo with git.default-relative-commit set to HEAD^ on a
branch tracking a remote (that is different from HEAD^), and checked that
the diff against HEAD^, not the remote, was published.

Reviewers: jungejason, epriestley, vrana

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2409
2012-05-07 09:54:47 -07:00
epriestley
0253bb9475 With --verbatim, update some fields automatically when updating revisions
Summary:
Essentially D2391, but with, uh, more comments?

  - I forgot that we already implemented shouldOverwriteWhenCommitMessageIsEdited(). This patch already behaves nearly correctly.
  - Requires changes in D2412.
  - Use `'edit' => 'edit'`, which does the same thing as `'edit' => true`, but is more correct after the "edit" / "create" split.
  - Under "--verbatim", always get the message "from the user", which means "from the working copy" because verbtatim disables the editor part.

Test Plan:
      - Created and updated revisions with `arc diff`.
      - Created and updated revisions with `arc diff --verbatim`.
      - Updated revisions with `arc diff --edit`.

Reviewers: jungejason, btrahan

Reviewed By: jungejason

CC: vrana, aran

Differential Revision: https://secure.phabricator.com/D2411
2012-05-07 08:16:29 -07:00
epriestley
d40a30f10f Finish "Committed" -> "Closed" changes
Summary:
Clean up the remaining odds-and-ends here -- move to "differential.close", get rid of the old constant, etc.

I'll wait a week or two to land this since "differential.close" just landed and all the other stuff is trivial.

Test Plan: Grepped for "committed".

Reviewers: btrahan, vrana, Makinde

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T909, T1182

Differential Revision: https://secure.phabricator.com/D2309
2012-05-07 08:16:14 -07:00
epriestley
9f3a0963cb Add "arc get-config" and "arc set-config" for managing ~/.arcrc values
Summary:
The major thing I want to do here is allow you to set a default Phabricator URI, so we can make "arc paste", and "arc upload", "arc download" work anywhere.

We can also relax the .arcconfig requirements (request from @csilvers).

Test Plan:
Get/set some values?

iiam

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2400
2012-05-07 06:07:23 -07:00
epriestley
b2dc11940f Clean up some "arc" edge cases in Mercurial
Summary:
  - We no longer need color options since we fake our way through parsing ANSI colorized diffs and use HGPLAIN (on Windows, too!). Drop 'em.
  - In the case where you have nothing outgoing, we don't cache the relative commit and thus run "hg outgoing" too many times, which is fairly slow (even if you have nothing outgoing). Cache it.

Test Plan: Ran "arc diff --trace" in a mercurial working copy with nothing outgoing; verified we run "hg outgoing" only once.

Reviewers: Makinde, csilvers, btrahan

Reviewed By: Makinde

CC: aran

Differential Revision: https://secure.phabricator.com/D2399
2012-05-04 15:46:10 -07:00
vrana
b77c379441 Document first line behavior in update message
Test Plan: (This diff)

Reviewers: epriestley, jungejason

Reviewed By: jungejason

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2389
2012-05-04 13:00:21 -07:00
vrana
299c673b7c Don't ask user to use saved message in arc diff --verbatim
Test Plan:
Cancel `arc diff`.
Verify that the message is created.
Run `arc diff --verbatim` and see no reuse message question.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2390
2012-05-04 12:56:31 -07:00
vrana
4d1e5b1b74 Warn before parse errors in arc diff --verbatim
Summary: With `--verbatim` flag, notes created from parse errors are never displayed to user resulting in blank fields.

Test Plan:
- `arc diff --verbatim` with invalid Cc
- `arc diff --verbatim` with all fields correct

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2395
2012-05-04 12:42:51 -07:00
Marke Hallowell
4645204c11 Updated arc land workflow to use temp file approach for messages to avoid newline escaping issue in windows.
Test Plan: Ran arc land locally with both the mutable default option and with the --merge flag to ensure that messages are set properly.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2372
2012-05-02 16:48:49 -07:00
epriestley
52e08cc6c5 Fix "HGPLAIN" environmental variable in Windows
Summary: In Windows, you can't use `X=y cmd` syntax to set variables. Use "set X=y & cmd" instead.

Test Plan:
  - Ran "arc diff" in a Mercurial repo in Windows, created D2367.
  - Verified this does //not// cause 'HGPLAIN' to be set in the outer shell (where you type "arc diff").

Reviewers: Makinde, tido, indiefan, btrahan

Reviewed By: tido

CC: aran

Maniphest Tasks: T1179

Differential Revision: https://secure.phabricator.com/D2368
2012-05-02 12:40:02 -07:00
Marke Hallowell
9a718f210a Using a temp file for git commit --amend instead of passing multi-line message to the shell. Avoids escaping issue on windows.
Test Plan: Run arc diff locally, verify via git log that the commit is amended afterwards (using the mutable history paradigm)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2369
2012-05-02 12:39:46 -07:00
epriestley
47ed2aca95 Don't check working copy status for "arc commit --show"
Summary:
We do unnecessary working copy checks under "--show", even though the working copy isn't relevant.

Also, 'sourcePath' may not be set (e.g., "arc commit --show --revision X" where X is some "--only" revision).

Test Plan: Ran "arc commit --show --revision 1" against some test data, got clean output.

Reviewers: vrana, btrahan, jungejason

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2353
2012-05-01 10:35:14 -07:00
epriestley
c0c3c8a113 Remove "--no-decorate"
Summary: Apparently my advice here was terrible, and `--no-decorate` and `--decorate=no` are both very recent additions to Git which a bunch of users don't have. Get rid of them since D2344 allows us to parse all decorate levels anyway.

Test Plan: Tried to google "git changelog", got a bunch of pages about managing changelogs with git.

Reviewers: zeeg, ehren

Reviewed By: ehren

CC: ehren, aran, NorthIsUp

Differential Revision: https://secure.phabricator.com/D2354
2012-04-30 17:36:50 -07:00
epriestley
7070d0a065 Show text of moved files in Differential
Summary:
"git diff -M -C" generates useful metadata (moves/copies) but (for a pure move) no diff text. Synthetically build the diff text after the fact so this information is available in Differential.

This patch is kind of nasty but I couldn't see a cleaner way to do it. :/

This also needs some UI changes in Differential: we get a full-green new file right now, but it would be better to default-hide it with "This file was moved. Show More" or similar.

Test Plan: Moved a file, ran "arc diff", got textual diff.

Reviewers: aran, tuomaspelkonen, jungejason, btrahan, vrana

Reviewed By: vrana

CC: aran, epriestley, vrana

Maniphest Tasks: T230

Differential Revision: https://secure.phabricator.com/D479
2012-04-30 16:47:12 -07:00
Ehren Kret
b32b868a61 add support for using Arcanist with git's log.decorate setting enabled
Summary:
Arcanist fails to find git's 'commit <hash>' header when log.decorate is
set in one of git's config files. git adds the named refs that point to
the commit in parentheses following the hash. This changes the regex
used by arcanist to match git commit headers to optionally match the
branch names in parentheses following the hash.

Test Plan:
Run `git config --global log.decorate short` and check that `arc diff`
runs successfully.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2344
2012-04-30 14:14:23 -07:00
epriestley
e9ab03a48e Use Filesystem::getMimeType() in Arcanist
Summary: Missed this when getting rid of all the 'file' calls.

Test Plan: Meta.

Reviewers: btrahan, vrana, jungejason

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1159

Differential Revision: https://secure.phabricator.com/D2327
2012-04-27 12:48:47 -07:00
Julius Seporaitis
cb051d8568 Wrapper for 'nose' unittest and code coverage tools.
Summary:
Wrapper for Python 'nose' (http://readthedocs.org/docs/nose/en/latest/)
testing tool.

Test Plan:
Install latest 'nose' v1.1.3. Currently it is available through
Github only (``pep install git+https://github.com/nose-devs/nose.git``).

Create a Python project with following structure:

  /package_name/module_name.py
  /tests/package_name/test_module_name.py

Write some tests

Run ``arc unit``

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin, zeeg

Differential Revision: https://secure.phabricator.com/D2322
2012-04-27 12:12:20 -07:00
epriestley
dd11fee5ef Fix PhutilUnitTest issue with symlinks that point into a libphutil library
Summary: Currently, if you change a symlink outside a libphutil library and the link target is something inside a libphutil library, we may enter an inifite loop in the "do { ... } while(...)" later. Just bail if the loop won't resolve.

Test Plan: Ran arc unit, Airtime reported the issue resolved by a similar fix.

Reviewers: cpiro, btrahan

Reviewed By: cpiro

CC: aran

Differential Revision: https://secure.phabricator.com/D2318
2012-04-25 16:13:04 -07:00
Edward Speyer
946a9e44a3 Allow tests to be skipped
Summary:
Allow tests to be skipped by calling assertSkipped().  It's not really
an assertion of anything tangible; more like "assert that we can't
really assert anything right now".

Test Plan: Added a new test to the PhutilUnitTestEngineTestCase.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2312
2012-04-24 21:45:22 -07:00
vrana
cc1e4d4676 Lint libraries without __init__
Summary: After D2207.

Test Plan:
`arc lint` on D2208.
`arc lint` on mistyped class name.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2306
2012-04-24 15:07:55 -07:00
epriestley
9c4c1de512 Autocomplete branches to "arc land"
Summary:
  - Add branch name tab completion to "arc land".
  - Default to landing the current branch.
  - This is a little bit hacky but not too terrible. I'm planning to move the whole thing to PhutilArgumentParser at some point so that'll be an opportunity for a big refactor.

Test Plan: Hit tab, landed this branch.

Reviewers: zeeg, btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran, kdeggelman

Differential Revision: https://secure.phabricator.com/D2293
2012-04-23 14:09:29 -07:00
Edward Speyer
dd6ffa4a13 [Tests] Only use concrete TestCases
Summary:
Don't use abstract subclasses of ArcanistPhutilTestCase, only use
concrete ones.

This lets you put common functionality in an abstract BaseTestCase
(which itself is a subclass of ArcanistPhutilTestCase), then implement
concrete subclasses of the BaseTestCase.

Test Plan: Tested with a simple Base -> {Case1, Case2} setup.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2300
2012-04-23 10:40:56 -07:00
epriestley
2831d075c0 Remove only trailing "#" and empty lines as comments from CLI editors
Summary: Don't strip numbered lists in comment bodies, etc.

Test Plan: Unit tests, meta-testing this diff.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1124

Differential Revision: https://secure.phabricator.com/D2262
2012-04-18 06:08:41 -07:00
epriestley
da4b6b5799 Rename "arc mark-committed" to "arc close-revision"
Summary:
  - Replace SVN-specific language with VCS-agnostic language.
  - Add new "arc close-revision", works exactly like "arc mark-committed" but with agnostic language.
  - Use status constants, not status strings.
  - Mark "arc mark-committed" deprecated.
  - Remove deprecated "arc merge".

Test Plan: Ran "arc mark-committed", "arc close-revision".

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran, Makinde

Maniphest Tasks: T909

Differential Revision: https://secure.phabricator.com/D2244
2012-04-17 13:51:10 -07:00
vrana
c320e0987d Don't advice using --less-context if already used
Test Plan:
  arc diff
  arc diff --less-context

Reviewers: blair

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2233
2012-04-14 21:50:52 -07:00
epriestley
ea0f737e85 Drop <project + branch> herusitic from Git
Summary: See rage in T1117. Don't use the <project + branch> heuristic anymore..

Test Plan: Ran "arc diff --strict HEAD^" on a commit stacked on top of this one, got no matches.

Reviewers: btrahan, vrana, simpkins, beng

Reviewed By: btrahan

CC: aran, avive

Maniphest Tasks: T1117

Differential Revision: https://secure.phabricator.com/D2221
2012-04-13 10:55:28 -07:00
epriestley
56cdc31426 Fix some --only / --preview / SVN issues with Arcanist
Summary:
  - Historically, "--preview" was forbidden under SVN. No reason for that now.
  - The "--auto" patch moved the "--preview" / "--only" checks later than they should be.
  - Fix an issue with Conduit query construction in SVN.

Test Plan: Ran "arc diff --preview" in an SVN working copy. Ran "arc diff" in an SVN working copy.

Reviewers: svemir, btrahan, vrana, jungejason

Reviewed By: svemir

CC: aran

Differential Revision: https://secure.phabricator.com/D2218
2012-04-12 10:32:54 -07:00
Git user
83ad377bdb Read default relative commit from scratch file with newline
Summary:
When people create the .arc/default-relative-commit scratchfile with $EDITOR of
choice, their editor usually puts a newline at the end, which breaks arc diff.
We should trim the newline before using the contents of the scratchfile.

Test Plan:
ran arc diff in a working copy that contained a .arc/default-relative-commit
with a newline

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2209
2012-04-11 17:44:57 -07:00
epriestley
d2915d8c5f Don't let "arc which" identify the working copy as belonging to a different project
Summary: If you have two projects (say, libphutil and arcanist) and you prepare a patch for one of them on branch "master", run "arc diff", and then prepare a patch for the other one on the same branch, "arc diff" will try to update the first revision when you run it. Instead, make it smart enough to stay within arc projects.

Test Plan: Ran "arc which" in circumstances where it previously generated a false positive, no false positive.

Reviewers: btrahan, vrana, jungejason

Reviewed By: jungejason

CC: aran

Maniphest Tasks: T1100

Differential Revision: https://secure.phabricator.com/D2199
2012-04-10 16:06:57 -07:00
epriestley
7ea51b6bb7 If a Git upstream is configured for the current branch, always use that as the default relative commit
Summary: See discussion in D1861.

Test Plan: Ran "arc diff" on master, got an upstream-based relative commit. Ran "arc diff" on a feature branch, got a config-based relative commit. Ran "arc diff x", got an argument-based relative commit.

Reviewers: btrahan, vrana, davidreuss, elgenie

Reviewed By: davidreuss

CC: aran

Differential Revision: https://secure.phabricator.com/D2192
2012-04-10 15:33:31 -07:00
Ben Gertzfield
2c02e79df4 Allow defining aliases in .arcconfig.
Summary:
For Objective-C repositories, we want to provide aliases to
arc diff --amend-autofixes by default.

This adds the ability to define aliases in .arcconfig (overridden
by any specified in the user config, of course).

Test Plan:
Tested defining alias with nothing in .arcconfig, with
an alias in .arcconfig.  Tested arc alias outside of working
repository.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2191
2012-04-10 12:42:13 -07:00
Ben Gertzfield
14d49d2565 Add ArcanistLintSeverity::SEVERITY_AUTOFIX.
Summary:
Xcode (a popular code editor on Mac OS X) has no facility
to trim trailing whitespace automatically.

This adds a new lint severity "AUTOFIX" that's between
WARNING and ERROR. When running the linter, any lint message
whose severity is AUTOFIX will automatically be patched.

Furthermore, if all lint messages returned from the engine are
AUTOFIX, we'll automatically amend HEAD with the patch.

Test Plan:
arc lint on files with and without trailing whitespace,
with and without UTF-8 contents to confirm those still error

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2125
2012-04-10 12:42:09 -07:00
epriestley
55dce2beeb Make --auto creates actually work in SVN and HG
Summary:
--auto doesn't work right now on the implicit --create pathway in SVN and HG because we hit these conditions.

Also improve a message.

Test Plan: Ran "arc diff" in unaffiliated working copies in HG and SVN.

Reviewers: svemir, btrahan, vrana, jungejason

Reviewed By: svemir

CC: aran

Differential Revision: https://secure.phabricator.com/D2187
2012-04-10 12:06:41 -07:00
epriestley
5068e8ad56 Provide a "loadFileDataCallback" for ArcanistBundle
Summary: See next diff for an explanation of this issue.

Test Plan: See next diff.

Reviewers: Makinde, btrahan, vrana, jungejason

Reviewed By: Makinde

CC: aran

Differential Revision: https://secure.phabricator.com/D2174
2012-04-09 17:34:45 -07:00
Evan Priestley
94c695cf0f Merge pull request #25 from Koolvin/arc_close
Add arc close command
2012-04-09 08:46:14 -07:00
vrana
a2c125d4ef Call phutil_passthru() instead of passthru() in liberate
Summary: Solves T1085 and is probably slightly better anyway.

Test Plan:
  arc liberate

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Maniphest Tasks: T1085

Differential Revision: https://secure.phabricator.com/D2151
2012-04-08 21:34:36 -07:00
Koolvin
e7d9ff18d3 Add arc close command
Summary:
```arc close T1088 --status wontfix --message "I'm not going to fix this."```
T1088 is the test task to screw with, so feel free.

Test Plan: ```arc close T1088 --status [ resolved | wontfix | invalid | duplicate | spite | open ] -m "Message"```

Reviewers: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2162
2012-04-08 20:57:38 -07:00
epriestley
2c599f8928 Raise lint warning on missing space after comma
Summary: Saw this in a diff somewhere; complain about it.

Test Plan: Unit coverage.

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1060

Differential Revision: https://secure.phabricator.com/D2153
2012-04-08 16:09:11 -07:00
Koolvin
b553af2763 Add arc tasks command
Summary:
Added `arc tasks`:

%%%arc tasks
arc tasks --view-all    // View Open and Closed Tasks
arc tasks --by-status   // Group By Status
arc tasks --by-priority // Group By Priority%%%

Test Plan: Connect to conduit and run arc tasks >> make sure you have tasks =p

Reviewers: epriestley, indiefan

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T749

Differential Revision: https://secure.phabricator.com/D1943
2012-04-07 17:40:25 -07:00
epriestley
038d8e86d6 Make "--auto" the default for "arc diff"
Summary:
NOTE: This is a disruptive change to how 'arc diff' behaves by default.

Many years ago, Differential (then DiffCamp) supported SVN. Someone added a "-i" mode to the "diffcamp" script so you could "git show | diffcamp -i", and thus we were
forever bound to storing metadata in commit messages.

But this isn't a common use case outside of Facebook + git-svn, and isn't very flexible. We now have a great deal of flexibility to identify revisions based on
hashes, branch names, etc, and to sync metdata from web to CLI and back. I want to jettison the commit-message-bound artifacts of the tool's history, and move to a
more flexible, modern workflow.

I added "--auto" a while ago, which figures out if you want to create or update a diff automatically, and then prompts you for whatever data it needs, reading
information if it can from commit messages in the range. This is a vastly better workflow in general, especially for SVN and Mercurial users (who currently need to
jump to the web UI to create revisions). It's better for git users too, since they don't need to use template commits and don't have to muck with or configure
templates. However, it's a nontrivial change to git users' core workflow that is clearly different in more ways than it is clearly better.

  - This might be contentious, but probably not toooo much, I hope?
  - I also deleted the (fairly ridiculous) workflow where we sync commit message changes from the working copy. I think two or three people will be REALLY upset about
this but I have no sympathy. "--edit" covers this and has been around for like two years now, and making the commit message and web dual-authoritative was always a bad
idea that we only ever half-accommodated anyway (see giant swaths of removed TOOD nonsense).

Test Plan:
  - I've been using "--auto" exclusively for like a month, it seems to work well.
  - Created/updated SVN, Git and HG diffs with "arc diff" under this workflow.

Reviewers: btrahan, jungejason, nh

Reviewed By: btrahan

CC: Makinde, vrana, zeeg, mbautin, aran, yairlivne, 20after4

Maniphest Tasks: T614

Differential Revision: https://secure.phabricator.com/D2080
2012-04-07 10:39:27 -07:00
epriestley
39c3a0c43a Fix an issue with "arc diff --update" in Git on immutable workflows
Summary:
This should be a raw text block, not a parsed message object.

I broke this in rARC1f13e022cdc9bf4859274a83784bd615caf62ef9 when I improved Mercurial support.

See: https://github.com/facebook/arcanist/issues/23

Test Plan: (Will update this diff...)

Reviewers: vrana, jungejason, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2136
2012-04-07 10:36:16 -07:00
vrana
a5f0323d5c Return $this from didApplyPatch() shortcut
Test Plan: https://secure.phabricator.com/diffusion/ARC/browse/master/src/lint/patcher/ArcanistLintPatcher.php;bd7dc8abaa7bb4c0$75?view=blame

Reviewers: epriestley, jungejason

Reviewed By: jungejason

CC: aran

Differential Revision: https://secure.phabricator.com/D2101
2012-04-04 15:11:52 -07:00
epriestley
bd7dc8abaa Allow configuration of a weak per-project default relative commit
Summary: Allows you to set a default in .arcconfig. This default is overriden by any .arc/ setting.

Test Plan: Ran "arc diff" with a .arcconfig setting but no .arc/ setting, got a diff against the specified relative commit.

Reviewers: nh, btrahan

Reviewed By: nh

CC: aran

Differential Revision: https://secure.phabricator.com/D2093
2012-04-03 16:06:43 -07:00
vrana
8971a91444 Return $this from setters
Summary:
Most setters returns `$this` but some don't.
I guess it's not by purpose.

Test Plan:
  arc lint

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2084
2012-04-02 18:47:59 -07:00
epriestley
39b3778287 Revenge of the git relative commit default
Summary:
The default of "arc diff" to "arc diff HEAD^" in git is universally confusing to everyone not at Facebook.

Drive the default with configuration instead. Even at Facebook, "origin/trunk" (or whatever) is probably a better default than "HEAD^".

See D863 for the last attempt at this.

NOTE: This is contentious!

Test Plan: Ran "arc diff", got prompted to set a default. Ran "arc diff" from a zero-commit repo, got sensible behavior

Reviewers: btrahan, vrana, nh, jungejason, tuomaspelkonen

Reviewed By: btrahan

CC: aran, epriestley, zeeg, davidreuss

Maniphest Tasks: T651

Differential Revision: https://secure.phabricator.com/D1861
2012-04-02 16:52:20 -07:00
vrana
a0c5835a43 Whitespace 2012-03-30 14:55:55 -07:00
epriestley
3ae1bf1a8c Add a lint check for clobbering locals with iterators
Summary:
See D2049, D2050. Identify reuses of locals as iterator variables. Before raising an error, we require:

  - Variable is declared before the loop.
  - Variable is used after the loop, ignoring uses as an iterator variable.

I think this identifies all problems with a very low false positive rate (the false positives are suspicious/unconventional code, but not necessarily errors).

Also fix an issue identified by the linter.

Test Plan:
  - Verified this identified the bugs in D2049 and D2050.
  - Ran linter against libphutil/, arcanist/ and phabricator/ (see D2051, this, and next diff).
  - Ran unit tests.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, epriestley, jungejason

Differential Revision: https://secure.phabricator.com/D2052
2012-03-29 13:21:18 -07:00
epriestley
ff94d699fe Minor Arcanist fixes
Summary:
Addresses concerns in rARCefb8219196abf047f14b505959e54d078e1df6d3:

  - As I recall, the intent of "generateFile" was that these warnings would replace all the other warnings for that file, under the theory that if one warning caused regeneration of
the file the other warnings were irrelevant.
  - However, this code never had any effect and I haven't seen any issues with the behavior.
  - So, just remove it.

Addresses concerns in rARC070e963d1c26879e47eab19a2377e388c2f166c5:

  - Ran "arc liberate --all".

Test Plan: Ran "arc lint" after removing an "__init__.php" with and without a "fixed" generateFile block, there was no behavioral change. So I just nuked it.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2049
2012-03-29 13:21:10 -07:00
vrana
30f036c6b9 Use assert_instances_of()
Summary: D2042

Test Plan:
- `arc lint` with dependent message
- `arc liberate`
- `arc diff`

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2048
2012-03-29 08:35:49 -07:00
vrana
edb6a38389 Avoid double indenting in console wrapping
Summary:
D2016 changed the behavior of `phutil_console_wrap()`.
The new behavior is better so I am fixing callsites instead of the function.

Test Plan:
  arc help help

Verify that the options descriptions is not indented with 28 spaces.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2047
2012-03-28 22:28:15 -07:00
epriestley
070e963d1c Minor, squelch a warning about reference variables.
Auditors: vrana
2012-03-26 10:03:59 -07:00
epriestley
9db7f294ef Show a better expected vs actual for tests with large output
Summary: When tests have a lot of output, show a diff of the expected/actual.

Test Plan: Used this when developing D2016 to examine large output usefully.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2017
2012-03-26 09:43:47 -07:00
epriestley
b67ce7e534 Raise a better error message when "arc patch" fails because of filename case changes
Summary: Git can't apply filename case change patches on case-insensitive filesystems. Some day we could manually do this ourselves, but it's fairly rare and complicated -- just raise a useful warning.

Test Plan: Tried to apply a case-changing patch, got a good error.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T618

Differential Revision: https://secure.phabricator.com/D2015
2012-03-26 09:43:37 -07:00
epriestley
4ca58d1129 Improve compatibility of "arc patch" on Windows
Summary: Can't use (cd ...) on windows.

Test Plan: Ran "arc patch" successfully.

Reviewers: Makinde, btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T124, T1034

Differential Revision: https://secure.phabricator.com/D1987
2012-03-25 09:32:20 -07:00
epriestley
1acbe76cbf Minor, fix clowniness. 2012-03-23 08:56:38 -07:00
epriestley
3991e679e7 Minor, fix inverted condition. 2012-03-23 08:53:47 -07:00
epriestley
e31bc81b6c Update 'arc land': add --squash, add default config, fix windows compat
Summary:
  - We have "--merge", added similar "--squash" for completeness.
  - Switched away from (cd .. && ...) pattern which is not functional on Windows.
  - Allow a default --onto to be specified, if master isn't the best default for a project.

Test Plan:
  - Did --hold --keep dry runs, changes landed properly.
  - Set a default onto branch in .arcconfig.
  - Ran --merge and --squash together to verify conflict configuration.

Reviewers: btrahan

CC: aran, epriestley

Maniphest Tasks: T124, T1033

Differential Revision: https://secure.phabricator.com/D2001
2012-03-22 18:28:35 -07:00
epriestley
3bff9417e9 Set relative commit early in "arc diff"
Summary:
In Mercurial, we figure out if the working copy is dirty with "hg diff", and do a somewhat expensive merge-base / outgoing operation if the relative commit isn't set. We can set the relative commit earlier and avoid some extra work.

We also may incorrectly cache this state (diff from merge-base of outgoing to tip) and pass the wrong rev and file dirty list to the linters.

Test Plan: Made commits which changed (A, B) and then (A). Ran "arc diff tip^". Before this change, observed full outgoing + merge base resolve and both "A" and "B" passed to lint. Observed execution of fewer commands and lint executing against "A" only after this change.

Reviewers: Makinde, btrahan

Reviewed By: Makinde

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1998
2012-03-22 17:22:52 -07:00
epriestley
e8accf4b9f Instead of looping forever, resolve the relative commit
Summary: Obvious error in refactoring code around getCanonicalRevisionName() in D1954.

Test Plan: Ran "arc diff" without looping. Can you verify this fixes your case?

Reviewers: Makinde, btrahan

Reviewed By: Makinde

CC: aran, epriestley

Maniphest Tasks: T1025

Differential Revision: https://secure.phabricator.com/D1970
2012-03-21 11:07:15 -07:00
epriestley
31a54d9b4a When a mercurial working copy has uncommitted changes, prompt to include them in "arc diff"
Summary:
See task. Allow mercurial users to diff with uncommitted changes.

  - By default, commit range is merge-base of `hg outgoing` to `.` (dirstate).
  - You can get JUST dirstate with `arc diff tip` or similar.
  - This ended up being a giant mess various other changes to deal with empty `hg outgoing` and empty dirstate.

Test Plan: Diffed with uncommitted changes, got sensible prompts and results.

Reviewers: Makinde, btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T998

Differential Revision: https://secure.phabricator.com/D1954
2012-03-19 19:17:10 -07:00
epriestley
cdcb5cc25d Minor, address @btrahan feedback. 2012-03-19 19:16:50 -07:00
epriestley
d516f39bf3 Throw a helpful message when users run "arc diff --raw --update".
Summary: We crash and burn right now, trying to launch an interactive editor against a non-tty stdin. Raise a helpful error message instead.

Test Plan: Will run "arc diff --raw --update".

Reviewers: btrahan, yairlivne

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1949
2012-03-19 19:15:58 -07:00
epriestley
4e888458d7 In "arc patch", use "cat-file -t" instead of "rev-parse --verify" to check for commits.
Summary:
  - `git rev-parse --verify` "verifies" very valid-looking commit name, not just valid commit names.
  - Currently, if we can't find the base rev we'll incorrectly "verify" it and then fail on "git checkout -b <branch> <some bogus commit>".
  - Instead, use `git cat-file -t`.
  - See similar fix in D1590.

Example:

  $ git rev-parse --verify aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Test Plan: Ran "arc patch" in a mismatched local, hit "Y" to branch, got a branch off HEAD instead of an error.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1947
2012-03-19 19:11:52 -07:00
epriestley
89753d5d49 Don't fatal without Conduit for "--patch" and "--bundle"
Summary:
In some workflows, we don't have Conduit at all, so we'll fail with a raw exception. Test for conduit presence before trying to make the encoding call.

Also move some "instanceof" logic for updates into RepositoryAPI (factoring, windows compat).

Test Plan: Ran "arc patch --patch some.patch".

Reviewers: 20after4, davidreuss, nh, btrahan

Reviewed By: 20after4

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1935
2012-03-16 13:40:33 -07:00
epriestley
f15479c832 Fix an issue with unified patch generation for terminal newline changes
Summary:
We currently detect the "\" as a change, and may generate a hunk like this, without changes.

  @@ -97,4 +98,4 @@
   mmm
   mmm
   mmm
  \ No newline at end of file

While "git apply" is OK with this, "patch" is not. Instead, don't detect this as a change (it is always accompanied by - / + if it's a real change).

Test Plan: Successfully applied a previously-failing SVN patch to a file without a terminal newline that had nonlocal changes.

Reviewers: 20after4, nh, btrahan

Reviewed By: 20after4

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1934
2012-03-16 13:40:11 -07:00
Nick Harper
dc6816789a Remove debugging print from a test case
Test Plan: reran the test

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1906
2012-03-15 14:30:33 -07:00
David Reuss
545f51a4fb Respect custom set encoding in patch/export workflows
Summary:
In cases where a codebase is not UTF-8, we will attempt an conversion,
if an alternative encoding is given/configured.

This is now possible in two ways:

  - by configuring one under repository tracking in diffusion
  - by passing an --encoding option to the workflow

If the first is not available we will make a conduit call
to do an extra check and see if an encoding is configured directly with
phabricator.

Test Plan:
Tried various diffs with known encodings (mostly ISO-8859-1), and passed
it in, via stdin, or downloaded a known problematic revision from
phabricator, and they applied where they otherwise failed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T452

Differential Revision: https://secure.phabricator.com/D1880
2012-03-14 07:08:21 -07:00
epriestley
f673ab10b1 Strip colorized diffs, show line numbers in context
Summary:
  - When users pipe in colorized diffs, strip the colors instead of failing.
  - When showing context, show line numbers (we do show 3 lines around the failure, the failure was just on the first line).
  - Remove an irrelevant TODO comment (we handle this elsewhere now).

Test Plan: Unit tests.

Reviewers: Makinde, btrahan

Reviewed By: Makinde

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1887
2012-03-14 06:34:00 -07:00
Nick Harper
7494a95c40 [svn1.7] handle removed directories in svn in arc diff
Summary:
`svn rm $directory` removes the directory and its contents in svn 1.7, whereas
svn 1.6 only removes the directory's contents, so arc diff needs to not try
to read the directory.

Test Plan:
ran arc diff in a svn working copy that had a directory removed (with both
svn 1.6 and svn 1.7) and confirmed that the command did not throw an exception,
and that the removed directory was marked as directory (not a file).

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1889
2012-03-13 23:45:37 -07:00
Nick Harper
6dd511d0ef [svn1.7] Handle changes to svn properties in svn1.7 working copies
Summary: svn changed the format of property changes for svn1.7.

Test Plan: arc diff on a working copy with svn property changes

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1885
2012-03-13 16:34:13 -07:00
epriestley
ec9a3ddb23 Add a check to 'arc liberate' for loose .php files in the library root
Summary: @koolvin ran into this and was justifiably confused.

Test Plan: Put some random .php file in src/, ran arc liberate src/, got warned.

Reviewers: btrahan, Koolvin

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1878
2012-03-13 11:17:28 -07:00
Nick Harper
024d108661 [svn1.7] treat nonpositive rev numbers as added files
Summary:
svn 1.7 reports a rev number of -1 for added files; previous versions
reported a rev number of 0. Interpret nonpositive rev numbers to mean
the file was added.

Test Plan: ran arc diff on an svn1.7 working copy with added files

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1867
2012-03-13 11:11:48 -07:00
epriestley
0dd9f5f3a5 Add a test case to make sure prefix/suffix intraline diffs work correctly
Summary: Wanted to double-check that this works properly; it does, but might as well keep the test case.

Test Plan: Ran tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T970

Differential Revision: https://secure.phabricator.com/D1869
2012-03-12 18:21:44 -07:00
epriestley
d8b510596f Don't show "not executable" for files with no coverage information
Summary: We incorrectly merge array() into empty string, which is later interpreted as "this file is entirely not-executable". Instead, show no coverage information in the UI.

Test Plan: Looked at a README diff with no coverage information, got no UI render.

Reviewers: tuomaspelkonen, btrahan, zeeg

Reviewed By: tuomaspelkonen

CC: aran, epriestley

Maniphest Tasks: T965

Differential Revision: https://secure.phabricator.com/D1863
2012-03-12 17:04:51 -07:00
epriestley
d8967290e9 Improve "arc cover" parameters
Summary: Give "arc cover" --rev and paths parameters like "arc lint" and "arc unit".

Test Plan: Ran 'arc cover' with various rev/path things. Ran in SVN to verify it works/fails correctly.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T707

Differential Revision: https://secure.phabricator.com/D1860
2012-03-12 17:04:20 -07:00
Edward Speyer
454a7de87e ArcanistRepositoryAPI: add getCanonicalRevisionName
Summary:
Resolves crazy stuff like 'HEAD' or '{2001-01-01T01:01:01}' into an
actual revision, with a provided implementation for git.

Test Plan: Tested in a hacky script.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1849
2012-03-12 16:12:01 -07:00
Nick Harper
36709ece41 Improve arc support for svn 1.7
Summary:
svn 1.7 no longer has a .svn directory in every subdirectory of the working
copy, only one in the root of the working copy (like git, except you can still
check out subtrees). Thus, we can't check whether we're in an svn repo by
looking for a .svn directory alongside the .arcconfig file.

Test Plan: ran arc diff in an svn 1.7 working copy where it previously wasn't working

Reviewers: epriestley, btrahan, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1848
2012-03-09 13:51:52 -08:00
epriestley
aecb8064a1 Raise a lint error when code uses a PHP 5.3 feature in Phabricator
Summary:
  - Add a lint check for PHP 5.3 features (namespaces, anonymous functions).
  - Add unit tests.
  - Disable it by default.
  - Enable it for us.

Test Plan: Ran unit tests.

Reviewers: btrahan, edward

Reviewed By: edward

CC: aran, epriestley

Maniphest Tasks: T962

Differential Revision: https://secure.phabricator.com/D1846
2012-03-09 13:51:02 -08:00
Edward Speyer
8f76800efc Make lint output look like a compiler
Summary:
Make lint output look like gcc errors / grep output; a format used by
editors to jump from a compiler error to a file+line of code which
triggered the error.

Test Plan:
In vim, I ran:

  :set makeprg=~/checkouts/devtools/arcanist/bin/arc\ lint\ --output\ compiler

Then:

  :make

And was able to jump directly to problematic lines of code.

Reviewers: jungejason

Reviewed By: jungejason

CC: aran, edwardspeyer, jungejason, codeblock, tuomaspelkonen, epriestley

Differential Revision: https://secure.phabricator.com/D550
2012-03-09 11:20:08 -08:00
Nick Harper
e462f2e84e [arcanist] respect severity disabled in PEP8 linter
Summary:
This allows for disabling certain PEP8 linter errors by calling
setCustomSeverityMap on an ArcanistPEP8Linter. However, any custom severities
besides disabled will be ignored.

Test Plan: arc lint

Reviewers: epriestley, andrewjcg

Reviewed By: epriestley

CC: jungejason, aran, epriestley

Differential Revision: https://secure.phabricator.com/D1839
2012-03-09 11:19:17 -08:00
epriestley
f57199268f Remove chooseRevision() and DifferentialRevisionRef
Summary: `arc which` and related workflows have supplanted these now-unused mechanisms.

Test Plan: Grepped for chooseRevision() and DifferentialRevisionRef.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1841
2012-03-09 08:57:24 -08:00
epriestley
a7866827a2 Fix another "arc patch" authentication issue
Summary: Similar to rARC298ed9cda55d90b755e4dc45d202213e91631888, work around "differential.anonymous-access" issues until we get proper permissions up.

Test Plan: Ran "arc patch" against a "differential.anonymous-acccess" install with a revision argument

Reviewers: btrahan, mbautin

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T848

Differential Revision: https://secure.phabricator.com/D1835
2012-03-09 08:57:18 -08:00