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

440 commits

Author SHA1 Message Date
vrana
ae416d8788 Unignore changes in .arc/
Summary:
It's inside `.git/` for some time.
It also ignored changes in `test.arc/`.

Test Plan: None.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3900
2012-11-06 20:59:31 -08:00
vrana
a83cb43d08 Move conversion to dictionary inside lint message
Summary: Maybe I will need it on other places.

Test Plan:
  $ arc lint --output json # on file with lint error

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3898
2012-11-05 22:39:35 -08:00
vrana
66d204be81 Delete license headers from files
Summary:
This commit doesn't change license of any file. It just makes the license implicit (inherited from LICENSE file in the root directory).

We are removing the headers for these reasons:

- It wastes space in editors, less code is visible in editor upon opening a file.
- It brings noise to diff of the first change of any file every year.
- It confuses Git file copy detection when creating small files.
- We don't have an explicit license header in other files (JS, CSS, images, documentation).
- Using license header in every file is not obligatory: http://www.apache.org/dev/apply-license.html#new.

This change is approved by Alma Chao (Lead Open Source and IP Counsel at Facebook).

Test Plan: Verified that the license survived only in unit tests and LICENSE file.

Reviewers: epriestley, btrahan, edward

Reviewed By: epriestley

CC: aran, Korvin, davidrecordon

Maniphest Tasks: T2035

Differential Revision: https://secure.phabricator.com/D3881
2012-11-05 11:16:24 -08:00
vrana
d4a97d87c8 Ask for explanation for skipping lint and unit
Summary: Fixes T2023.

Test Plan:
  $ arc diff --nounit # Abort
  $ arc diff --nounit
  $ arc diff --nounit --excuse 'Move fast and break things.'

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2023

Differential Revision: https://secure.phabricator.com/D3872
2012-11-03 22:34:12 -07:00
Bob Trahan
027483f29a modify arc diff workflow to only do amend optimization if git repository
Summary: fix for T2011, first option in list of possible fixes

Test Plan: ...do I really have to setup mercurial with mq? :D

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2011

Differential Revision: https://secure.phabricator.com/D3869
2012-11-01 16:47:08 -07:00
vrana
5c4d2ae765 Fix copy/paste error in comment 2012-11-01 16:21:12 -07:00
epriestley
24405e0e86 Fix arc diff --raw
Summary: I broke this in D3750. Calling `getRepositoryAPI()` triggers a check for workflow requirement of the repository API. Instead, we should just check if we alreayd have one.

Test Plan: Ran `cat x | arc diff --raw`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1998

Differential Revision: https://secure.phabricator.com/D3848
2012-10-31 11:50:43 -07:00
vrana
475a576fdc Require defining getWorkflowName()
Test Plan:
  $ arc help

Reviewers: epriestley, edward

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3742
2012-10-31 10:52:26 -07:00
Bob Trahan
522c35c1ed escape files properly in arc commit
Summary: turns out retina has files like image.png and image@2x.png. The latter breaks since '@' is a special command telling svn to "look for image at revision 2x.png" -- nonsensical garbage. If we add it to the end every time this error goes way.

Test Plan: touch 2@2.png; svn add '2@2@'; arc diff; <fill out form, accept commit>; arc commit -- observe commit working

Reviewers: epriestley

Reviewed By: epriestley

CC: mbishopim3, aran, Korvin

Maniphest Tasks: T1999

Differential Revision: https://secure.phabricator.com/D3845
2012-10-30 18:26:58 -07:00
epriestley
519e23f3a4 In arc diff, always check that you own a revision before trying to do anything with it
Summary:
Some users assume they can update anything, not just revisions they own (see https://github.com/facebook/arcanist/issues/54).

Currently, if you `arc patch` or `arc amend` and get a commit message, then `arc diff` for a revision you don't own, we:

  - Fail early with a very confusing message ("You can not review a revision you own!") if you are on the "Reviewers" line, until D3820.
  - Or fail very very late with a good error message, but after lint, unit and update messages.

Instead, check that you own the revision as early as we can.

Test Plan: Tried to update revisions I didn't own, got good error messages early on (with D3820).

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3821
2012-10-25 16:27:57 -07:00
epriestley
b8ead97637 Minor, fix obvious method name typo.
Test Plan: Ran `arc export --git`.

Auditors: btrahan
2012-10-25 13:38:23 -07:00
vrana
2d226f3110 Disallow using DD1 as revision ID
Test Plan:
  $ arc inlines --revision 1
  $ arc inlines --revision D1
  $ arc inlines --revision DD1

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3811
2012-10-24 11:33:12 -07:00
vrana
448e820eb6 Run unit on background also in waiting for confirmation with arc diff --excuse
Test Plan: Made lint error, slept in test, verified that tests are finished when I confirm `arc diff --excuse`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3803
2012-10-23 15:26:23 -07:00
vrana
0b02170723 Ask for lint and unit excuses asynchronously
Summary: This diff obsoletes D3385.

Test Plan: Made lint error, explained it, verified that unit already finished before I finished explaining (by adding `sleep(3)` to test).

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3786
2012-10-22 16:25:35 -07:00
epriestley
5981aa1df4 Make ArcanistDiffParser automatically load synthetic changes if the working copy is available
Summary: Make this harder to get wrong. Instead of requiring a separate call for synthetic data, automatically load it if we can.

Test Plan: Unit tests; `arc diff`.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T866

Differential Revision: https://secure.phabricator.com/D3750
2012-10-20 08:42:16 -07:00
epriestley
7cb3551dc7 Fix two arc issues
Summary:
  - I caused $parser to be reused in D3732 which I belived was safe, but actually isn't. We end up writing to the same changes. We should make it safe but there's some mess in Phabricator that needs to be cleaned up first.
  - One minor error code thing, variable is undefined.

Test Plan: Ran `arc export --git` on a moved file, got a better result. Ran some command which made me hit the other case and didn't get a fatal anymore.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3749
2012-10-20 06:13:12 -07:00
vrana
d09eb881a3 Print lint results before throwing
Summary:
When some linter throws then we don't print any result.
This is bad in case when the linter threw e.g. because of syntax error in some file which some other linter will tell us about.

Test Plan: Threw from a linter, made lint error in a file, saw error then exception.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3756
2012-10-20 05:03:22 -07:00
Edward Speyer
f0c0245957 Support --nobranch when not currently on a branch
Summary:
This is horrible and git specific, but fixes a case where people are using "arc
patch --nobranch ..." when they're not currently on a branch.

The old code assumed you were on a branch and used getBranchName() to record
this, in order to return to that branch later and cherry-pick the patch.

When not on a branch, and using arc patch --nobranch, this was trying to return
to the branch '(no branch)'.

Now, I detect that we're not on a branch and just record what HEAD is instead.

Test Plan:
Checkout the SHA of master (so I'm on master, but not on a branch) then try to
patch it with a feature diff:

  € git checkout e7a3ec68159d6847372cab5ad913f2f15aa7c249
  Warning: you are leaving 1 commit behind, not connected to
  any of your branches:

    ac1ad39 Updating a-file

  If you want to keep them by creating a new branch, this may be a good time
  to do so with:

   git branch new_branch_name ac1ad392350a51edd10343f12b9713f5e5b3707c

  HEAD is now at e7a3ec6... Fix arcconfig

  € arc patch --nobranch D7
  Created and checked out branch arcpatch-D7.
   OKAY  Successfully committed patch.

  € git branch
  * (no branch)
    feature
    haddock
    master

  € git log --oneline | head -2
  38c0235 Updating a-file
  e7a3ec6 Fix arcconfig

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3743
2012-10-19 12:12:57 -07:00
vrana
b52ee2fdee Temporarily unrequire defining getWorkflowName()
Summary:
We need to run new Arcanist over old code in Perflab.
We also need to run new Arcanist over new code (with already deleted custom `buildAllWorkflows()`).

This will work because old code overwrites `buildAllWorkflows()`.

Test Plan:
  $ arc help
  $ arc help # after deleting getWorkflowName() from one workflow

Reviewers: edward, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3741
2012-10-19 11:02:20 -07:00
vrana
94d283a453 Require defining workflows' synopses and help
Test Plan: Deleted `getCommandSynopses()` from workflow, ran `arc help`.

Reviewers: epriestley, edward

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3739
2012-10-19 11:01:57 -07:00
epriestley
ffac8d5c4c Improve arc handling of various binary file operations in Git
Summary:
See T866, D3521. Additional things this fixes:

  - `arc export` now exports binary data correctly.
  - `ArcanistBundle` unit tests now load and apply binary data correctly.
  - `arc patch` no longer relies on `base` configuration.
  - Adds tests to the tarball:

  commit df340e88d8aba12e8f2b8827f01f0cd9f35eb758
  Author: epriestley <git@epriestley.com>
  Date:   Wed Oct 17 15:46:11 2012 -0700

      Remove binary image.

  commit 3f5c6d735e64c25a04f83be48ef184b25b5282f0
  Author: epriestley <git@epriestley.com>
  Date:   Wed Oct 17 15:45:58 2012 -0700

      Copy binary image.

  commit b454edb3bb29890ee5b3af5ef66ce6a24d15d882
  Author: epriestley <git@epriestley.com>
  Date:   Wed Oct 17 15:45:35 2012 -0700

      Move binary image.

  commit 5de5f3dfda1b7db2eb054e57699f05aaf1f4483e
  Author: epriestley <git@epriestley.com>
  Date:   Wed Oct 17 15:45:09 2012 -0700

      Add a binary image.

Test Plan: Ran unit tests, `arc patch`, `arc export`, `arc diff`, `arc upgrade`.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T866

Differential Revision: https://secure.phabricator.com/D3732
2012-10-19 10:10:25 -07:00
epriestley
4c476c0201 Make Arcanist workflow names explicit
Summary:
Currently, adding a new workflow requires you to override ArcanistConfiguration, which is messy. Instead, just load everything that extends ArcanistBaseWorkflow.

Remove all the rules tying workflow names to class names through arcane incantations.

This has a very small performance cost in that we need to load every Workflow class every time now, but we don't hit __init__ and such anymore and it was pretty negligible on my machine (98ms vs 104ms or something).

Test Plan: Ran "arc help", "arc which", "arc diff", etc.

Reviewers: edward, vrana, btrahan

Reviewed By: edward

CC: aran, zeeg

Differential Revision: https://secure.phabricator.com/D3691
2012-10-17 08:35:03 -07:00
Edward Speyer
2d269aefed Use git-cherry-pick for arc patch
Summary:
This changes what --nobranch does, though not what it means.  In git, the patch
is applied to the git commit it is based off where it will commit cleanly, and
if you specify --nobranch then arc-patch will then switch back to your original
branch and try to cherry-pick the commit there.

If this fails, you end up with merge-conflict markers in the file which can be
handy.

Test Plan: https://secure.phabricator.com/P572

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3712
2012-10-16 16:46:21 -07:00
vrana
a850f1c6ef Don't pull message twice from Conduit in arc diff
Summary:
We currently pull message from Conduit twice in `arc diff` update.
Once in `buildCommitMessage()` and once in `buildRevisionFromCommitMessage()`.
Remeber that we already pulled it (and so it is authoritative) to save this call.

Even faster solution would be to not pull and update the message at all in common (non-`--edit`, non-`--verbatim` and such) update workflows but it's more involved.

Test Plan:
  $ arc diff --trace

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3716
2012-10-16 12:53:59 -07:00
vrana
eb5bdb03d0 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
2012-10-12 18:15:27 -07:00
vrana
3d00e0448d 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
2012-10-12 15:18:56 -07:00
Dereckson
646b37a343 (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
2012-10-12 07:41:24 -07:00
Dereckson
5725585f2d 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
2012-10-12 07:40:59 -07:00
David Reuss
a63db7cd6e 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
2012-10-11 12:40:43 -07:00
vrana
da74127fec 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
2012-10-08 16:34:18 -07:00
Bob Trahan
383fb42ba8 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
2012-10-03 14:54:43 -07:00
epriestley
b880dfd4c8 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
2012-10-02 11:01:49 -07:00
vrana
f0a91a30c8 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
2012-10-01 09:37:22 -07:00
epriestley
dffaa17e41 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
2012-09-30 19:40:54 -07:00
vrana
e58e408129 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
2012-09-28 09:56:57 -07:00
vrana
a6221ea166 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
2012-09-27 10:13:17 -07:00
vrana
b22e94d555 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
2012-09-26 09:44:42 -07:00
vrana
0a6be45f29 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
2012-09-24 12:02:54 -07:00
vrana
32e123c515 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
2012-09-24 11:04:19 -07:00
vrana
aa425c7ea9 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
2012-09-24 11:04:02 -07:00
vrana
e1b2d787c9 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
2012-09-21 15:29:22 -07:00
vrana
6bd2b372f5 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
2012-09-21 11:22:05 -07:00
vrana
6929f4e57e 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
2012-09-20 13:20:38 -07:00
vrana
7119f0c4cc 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
2012-09-20 13:19:24 -07:00
vrana
94f684e29e 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
2012-09-17 13:24:37 -07:00
vrana
589bccb716 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
2012-09-17 13:20:31 -07:00
vrana
3bbf9ccc3d Fix typo in comment 2012-09-14 17:52:24 -07:00
vrana
ac7b9e42d6 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
2012-09-13 22:36:46 -07:00
vrana
c50b18142d 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
2012-09-06 18:48:59 -07:00
vrana
466910c700 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
2012-09-04 23:13:43 -07:00
epriestley
a802a90123 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
2012-09-04 12:08:04 -07:00
katherine
b0cfe9d94d [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
2012-08-31 17:05:46 -07:00
epriestley
d79664a30d 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
2012-08-30 12:28:35 -07:00
Nick Harper
4a786f48de 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
2012-08-29 11:04:19 -07:00
vrana
600e052e72 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
2012-08-27 18:34:31 -07:00
epriestley
d83768a949 Minor, fix obvious typo in SVN patch workflow (@mroch). 2012-08-23 17:52:47 -07:00
vrana
7ba210f89a 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
2012-08-22 15:43:54 -07:00
vrana
129339019f 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
2012-08-22 11:49:59 -07:00
vrana
1779abef6f 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
2012-08-16 14:29:37 -07:00
vrana
13b64da47a Use console in unit inside diff 2012-08-15 15:54:34 -07:00
vrana
30bc4ca6e9 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
2012-08-15 15:49:50 -07:00
Wez Furlong
390bb280e1 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
2012-08-15 10:34:29 -07:00
vrana
ab602e3a52 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
2012-08-13 14:57:18 -07:00
epriestley
be3ce781bb 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
2012-08-12 08:50:01 -07:00
epriestley
edcc5cf6e1 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
2012-08-10 12:10:09 -07:00
epriestley
d2e0dc3e68 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
2012-08-09 18:39:41 -07:00
vrana
239b90a076 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
2012-08-09 17:44:57 -07:00
vrana
45fc4c992c 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
2012-08-08 19:04:59 -07:00
epriestley
678efa44c6 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
2012-08-08 12:58:27 -07:00
vrana
1ea9b8b02c 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
2012-08-08 12:19:14 -07:00
vrana
7e49cb4bfc 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
2012-08-08 12:07:12 -07:00
vrana
df81d25f1e 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
2012-08-08 12:04:15 -07:00
epriestley
cb5cfb28cd 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
2012-08-07 18:21:32 -07:00
epriestley
fae2adba9e 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
2012-08-06 11:56:01 -07:00
vrana
5d6e2a4e08 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
2012-08-05 18:39:32 -07:00
Alan Huang
877e6f743b 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
2012-08-03 12:00:54 -07:00
Bob Trahan
333bb09e04 Make arc patch show the superior error message if you are not authenticated
Summary: ...by making requireAuthentication return true if conduit is required.

Test Plan: mv ~/.arcrc ~/.arcrcbak; arc patch D12121; <verify error message>

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1522

Differential Revision: https://secure.phabricator.com/D3014
2012-07-29 11:57:36 -07:00
epriestley
8d9e1d8479 Minor, improve behavior of arc get-config. 2012-07-25 20:14:38 -07:00
Nick Harper
8e00d3cfaf Allow hyphens in arc library names
Summary:
We've had these in our library names and they're quite useful as word
separators. Allowing them shouldn't cause any trouble.

Test Plan:
ran arc liberate in an empty directory, and it didn't complain when I gave
it a name with a hyphen.

Reviewers: epriestley, vrana, jungejason

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3070
2012-07-25 18:37:25 -07:00
epriestley
768a125b58 Enrich arc configuration and add stronger typing
Summary:
See <https://github.com/facebook/arcanist/issues/45>

Currently, when the user types `arc set-config x false`, we set it as the string "false", which is usually not desirable. We have some steps toward typed config already, but expand on what we have and move as much stuff as possible into it, including all the config settings that aren't currently documented (there are still some lint-specific and project-specific settings not present here, but this is most of it).

Also make the `phutil_libraries` key a legacy name for `load`, and `immutable_history` a legacy name for `history.immutable`. Generally the goal here is to make config simpler and bring it more in-line with Git/Mercurial, which use dotted hierarchies.

I'll add some documentation here but I think most of the changes should be fairly straightforward.

Test Plan:
  - `arc set-config history.immutable on` (And similar -- sets to boolean true.)
  - `arc set-config history.immutable off` (And similar -- sets to boolean false.)
  - `arc set-config history.immutable derp` (And similar -- raises exception.)
  - `arc set-config history.immutable ''` (And similar -- removes setting value.)
  - `arc set-config --show`
  - `arc get-config`
  - `arc get-config base`

Reviewers: dschleimer, bos, btrahan, vrana

Reviewed By: dschleimer

CC: aran

Maniphest Tasks: T1546

Differential Revision: https://secure.phabricator.com/D3045
2012-07-25 18:37:09 -07:00
Alan Huang
316122c4e0 Create a mysterious new workflow
Summary:
Phabricator, as we all know, is marketed as a fun adventure game. However, while it is occasionally fun and often an adventure, it's so far been sorely deficient in the game aspect. This patch aims to rectify that oversight. (Presence of the first two qualities is not guaranteed.)

Note: In case there's any doubt, this is not a serious suggestion. I was bored.

Test Plan: Seriously?

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3026
2012-07-22 14:39:53 -07:00
epriestley
d2f0ffac7d Fix ambiguous argument where a branch has the same name as a file
Summary: Currently, if you have a branch named "docs" and a local file named "docs", `git show -s docs` complains because it's ambiguous. Use `--` to unambiguously mark branches as revisions, not files.

Test Plan: Ran `arc branch` in a working copy with a "docs" branch and a "docs" file, got expected results.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3030
2012-07-22 13:19:09 -07:00
epriestley
1e8add9583 Show "Fnnn" number in "arc upload"
Summary: We don't show the "Fnnn" number, but should.

Test Plan:
```$ arc upload README --conduit-uri=http://local.aphront.com:8080/
Uploading 'README'...
  F121 README: http://local.aphront.com:8080/file/data/fnu76irnwftin4akjpxv/PHID-FILE-yrjeblelwq6rv5a5gjko/README

Done.```

Reviewers: phleet, btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3023
2012-07-21 06:44:21 -07:00
Izzy Fraimow
1a111dc86c Adding confirmation message to 'arc todo' with information about the task created
Summary: 'arc todo' now logs a message with the task title and URI when run.

Test Plan: Run 'arc todo test' and see that it logs a message with the form 'Created task <task number>: '<task title' at <task URI>

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3016
2012-07-19 15:12:12 -07:00
vrana
cd2f8edb83 Speedup arc branch
Summary:
This reduces time of `arc branch` from 13s to 7s in my repo which is faster than `git branch --verbose` (10s).

The price for this speedup is that we loose the information [ahead 1, behind 21242] but we showed it only in branches with no revision so it's not a big deal.

Test Plan:
  $ arc branch

Reviewers: epriestley

Reviewed By: epriestley

CC: ahupp, aran, Korvin

Differential Revision: https://secure.phabricator.com/D3005
2012-07-18 18:01:44 -07:00
epriestley
f649837785 Dump problematic parser patches to temp files in "arc diff"
Summary: I'm trying to get a repro for a Windows + SVN patch issue. Dump patches which fail to a temp file so there's less bewilderment in getting the right patch handed over for analysis.

Test Plan: Forced a parse failure, ran "arc diff", inspected temp file.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2997
2012-07-17 16:16:18 -07:00
epriestley
802c0ed89f Fix some arc/mercurial issues
Summary:
  - In "arc which", we recommend "--rev x --rev ." to show changes. This is not accurate if there are uncommitted changes in the working copy. Just "--rev x" shows the correct changes (implicitly, the other end of the range is the working copy state).
  - When you diff only working copy changes, we currently incorrectly identify all your open revisions as belonging to the working copy. Instead, correctly identify none of them as belonging to the working copy (in theory, we could go farther than this and do path-based identification like SVN, but with --amend in hg 2.2+ this workflow should be going away in the long run).
  - If you have uncommitted working copy changes, never try to amend.

Test Plan: Ran "arc which .", "arc diff ." in a working copy with dirty changes, got better results than before.

Reviewers: dschleimer, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1507

Differential Revision: https://secure.phabricator.com/D2980
2012-07-17 16:16:11 -07:00
Andrew Gallagher
19e718a267 arcanist: add postponed linter support
Summary:
This uses a similiar approach as with postponed unittests, allowing
the lint workflow/engine to report postponed linter names.  After
the lint engine is run, a separate method is used to collect any
postponed linters and these are reposted to the diff via the
"arc:lint-postponed" property.

Also, a ##diff.wasCreated## was added allowing hooks to be called
immediately after the call ##differential.creatediff## with the
returned diff ID.

Test Plan:
Created diffs with a dummy lint engine which always reports a
postponed linter.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1332

Differential Revision: https://secure.phabricator.com/D2933
2012-07-11 18:09:05 -07:00
epriestley
daa210022d Fix "arc branch" performance regression
Summary: See discussion in T1467. This `log` logs everything in the repo. The old command was `show -s`, I just unthinkingly converted it and it doesn't matter for non-Facebook-sized repositories.

Test Plan: Ran "arc branch".

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1467

Differential Revision: https://secure.phabricator.com/D2963
2012-07-11 16:55:29 -07:00
epriestley
1b4205c1a1 Support an 'editor' config in arc
Summary: See D2955. Allow "arc set-config editor ..." to override all other editor settings.

Test Plan: Ran "arc set-config editor 'mate -w'", am typing this in textmate.

Reviewers: btrahan, ezfoxie

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1309

Differential Revision: https://secure.phabricator.com/D2956
2012-07-11 16:55:11 -07:00
Alan Huang
1f65a115cc Create an arc todo workflow for quickly creating a task.
Summary:
Run `arc todo o rly?` to create a Maniphest task
titled 'o rly?'. Pass --cc to add CCs besides yourself.

Test Plan: Ran `arc todo o rly?`. Behaved as expected.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T749, T1325

Differential Revision: https://secure.phabricator.com/D2952
2012-07-10 17:32:36 -07:00
Jason Ge
178b7346a1 Support invalid commit message in "arc branch"
Summary:
when a commit message contains error which fails the parsing, we 'arc branch' fails. One sample commit message we saw contains

  Differential Revision: 363812, 367983, 370452

The author manually committed the code without a real revision.

Test Plan: ran on the repo with problem commit and it succeeded.

Reviewers: epriestley

Reviewed By: epriestley

CC: malmond, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2944
2012-07-09 12:32:02 -07:00
epriestley
6366464202 Minor, stop arc upgrade from prompting for commit ranges. 2012-07-02 19:50:35 -07:00
epriestley
d3313e3fd7 Minor, don't explode when mbstring is missing and don't do utf8-to-utf8 conversions. 2012-07-02 19:34:59 -07:00
epriestley
563230b0fb Implement "arc:amended" and fix various problems with ArcanistMercurialAPI
Summary:
  - Implement "arc:amended", a base commit DSL rule which always selects HEAD (git) or `.` (hg) if it has "differential revision:" in the commit message. This is unambiguously correct in amend workflows, and can cover holes in other rules like "git:branch-unique(*)".
  - Fix a bunch of Mercurial stuff:
    - Our use of '.' is wrong, and based on a misunderstanding on my part of the behavior of `hg diff --rev . --rev .`, which means "ignore the second --rev flag", not ". means working directory state". As far as I know there's no explicit way to say "the working copy plus all its changes".
    - The `--prune` argument to "hg log" does not support symbolic names like ".^". Use revsets instead.
    - Reduce the number of times we need to run `hg branch`.
    - We can safely use "." to mean "the working copy revision", and do not need to do "hg --debug id" or similar.
    - Generally simplify some of the nonsense in the implementation left over from me having no idea how Mercurial works.

Test Plan:
Ran "arc which" in various scenarios in a mercurial working copy. I //think// I exercised all the changes.

Ran "arc which --base arc:amended" in hg and git working copies without "Differential Revision:" in head/. (no match) and with it (matched head/.).

Reviewers: dschleimer

Reviewed By: dschleimer

CC: Makinde, tido, phleet, aran

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2876
2012-07-01 11:06:05 -07:00
dschleimer
470e2eca67 [Arcanist] collect svn and bookmark info for Mercurial
Summary:
This increases the amount of information arc diff collects in
Mercurial repositories.  IN particular, it collects the active
bookmark, if there is one, and svn information in hgsubversion
repositories.

The Phabricator half of this is https://secure.phabricator.com/D2897

Test Plan:
[14:06:59 Sat Jun 30 2012] dschleimer@dev4022.snc6 ~/www-hg
www-hg  2941 $ ~/devtools/arcanist/bin/arc diff --only --conduit-uri http://phabricator.dschleimer.dev4022.facebook.com
HipHop Notice:  Undefined index: 1 in /data/users/dschleimer/devtools/arcanist/src/repository/api/ArcanistMercurialAPI.php on line 708
Created a new Differential diff:
        Diff URI: http://phabricator.dschleimer.dev4022.facebook.com/differential/diff/126/

Included changes:
  A       foo
HipHop Notice:  Undefined index: 1 in /data/users/dschleimer/www-hg/lib/arcanist/arcanist/FacebookArcanistConfiguration.php on line 81
mcproxy on this server is out of date
version: , expected version:
please restart (http://fburl.com/1787362)

[14:07:46 Sat Jun 30 2012] dschleimer@dev4022.snc6 ~/www-hg
www-hg  2941 $ echo '{"diff_id": 126}' | ~/devtools/arcanist/bin/arc call-conduit differential.getdiff --conduit-uri http://phabricator.dschleimer.dev4022.facebook.com | json_pretty | egrep -i 'bookmark|sourcecontrol'
        "bookmark": "bar",
        "sourceControlBaseRevision": "svn+ssh://tubbs/svnroot/tfb/trunk/www@583442",
        "sourceControlPath": "svn+ssh://tubbs/svnroot/tfb/trunk/www",
        "sourceControlSystem": "hg",

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1331

Differential Revision: https://secure.phabricator.com/D2896
2012-06-30 16:00:48 -07:00
epriestley
9c33c7330c Support "D123", not just "123", for "arc export --revision"
Summary: We currently error if a user types "--revision D123".

Test Plan: `arc export --git --revision D123`, got a diff.

Reviewers: vrana, jungejason

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2880
2012-06-27 18:33:28 -07:00
vrana
33e53a2852 Add newline 2012-06-27 11:21:24 -07:00
epriestley
d724ed0860 Minor, always show the current branch in "arc branch" 2012-06-26 12:45:47 -07:00
epriestley
67956306cb Remove all libphutil v1 support
Summary:
Delete all code related to v1 libraries in arcanist.

When users liberate a v1 library, prompt them to upgrade.

Test Plan: Reverted phabricator/ to a couple of months ago and liberated it. Got prompted to upgrade. Upgraded.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2861
2012-06-26 12:40:42 -07:00