1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 08:58:55 +02:00
Commit graph

791 commits

Author SHA1 Message Date
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
epriestley
cb56743521 Improve Arcanist + Windows + SVN compatibility
Summary: From "cmd.exe" with, e.g. SilkSVN, there are some issues getting arc to do anything useful. Resolve enough of them so that it's at least usable.

Test Plan: Created a revision from Windows / cmd.exe / arc / SVN.

Reviewers: btrahan, jungejason, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2984
2012-07-16 17:28:13 -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
1ec2d1095b Add mb_* functions to the external function list
Summary: The mbstring extension is common but not part of the PHP core, and we have a soft dependency on it but generally guard calls with function_exists(). Add the mbstring functions to the whitelist of known extension functions so lint doesn't raise errors about them if you don't have mbstring installed.

Test Plan: @ffx, can you verify this fixes the lint issue for you? Probably faster than recompiling my PHP without mbstring.

Reviewers: ffx, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2961
2012-07-11 16:55:21 -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
e5992a44fb Support "load" key in arc system configuration
Summary: I think @nh needs this at some point?

Test Plan: Added bogus and valid "load" to system config, got warning and load respectively.

Reviewers: nh, dschleimer, btrahan

Reviewed By: dschleimer

CC: aran

Differential Revision: https://secure.phabricator.com/D2931
2012-07-06 10:05:55 -07:00
epriestley
61da381c30 Print out the locations of libphutil and arcanist when arc is run with --trace
Summary: We currently print //additional// libraries, but not the core libraries, which makes diagnosing include problems more difficult than necessary.

Test Plan: ran `arc derp --trace`, got libphutil/arcanist locations

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2929
2012-07-06 10:05:49 -07:00
Jason Ge
f9415e37d0 Use binary safe diff in arc diff
Summary: Otherwise svn diff fails when the file is binary but the "svn:mime-type = application/x-shellscript" is missing in it.

Test Plan: arc diff succeeded against deleting a binary file which doesn't have svn:mime-type = application/x-shellscript.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2915
2012-07-03 13:33:28 -07:00
Sébastien Santoro
088091ca40 Make bin/arc less linux-centered, more UNIX-agnostic
Summary: Using /usr/bin/env in #! to allow the arc script to run as is in every UNIX OSes, like FreeBSD where bash is installed in /usr/local/bin/bash.

Test Plan: Tested on Solaris, Ubuntu, kFreeBSD/Debian and FreeBSD.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T1440

Differential Revision: https://secure.phabricator.com/D2913
2012-07-03 06:34:49 -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
epriestley
98b3dfda3b Implement "git:branch-unique(*)" in the base commit DSL
Summary:
Add a DSL command to select the first commit between HEAD and (the merge-base of some target with HEAD) that's on more than one branch.

This is similar to @csilvers' suggestion in <https://secure.phabricator.com/T1233#comment-8>. A specific problem this address is that, currently, if you use this workflow:

  $ git checkout -b feature
  $ git commit
  $ git checkout -b subfeature
  $ git commit

..i.e., develop dependent features in sub-branches, "arc diff" will try to send up (feature + subfeature). If you use the rule 'git:branch-unique(origin/master)' instead, diffing from 'subfeature' will correctly select only the commit(s) on 'subfeature'.

Test Plan: Constructed feature/subfeature branches, verified that we select the correct base commit.

Reviewers: dschleimer, csilvers, btrahan, jungejason

Reviewed By: dschleimer

CC: aran

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2866
2012-06-27 12:12:39 -07:00
vrana
33e53a2852 Add newline 2012-06-27 11:21:24 -07:00
epriestley
a235a041e5 Remove PhutilModuleRequirements
Summary: Yeah, we can nuke this.

Test Plan: Grepped for callsites.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2871
2012-06-26 18:22:36 -07:00
dschleimer
9edff28999 [Arcanist] add an arc:bookmark base for Mercurial
Summary:
This adds a new base option that Does the Right Thing (or as close to
it as I can get) for someone using Mercurial bookmarks as lightweight
branches, and where each branch should be one differential revision.
Specifically, it walks backwards through the ancestors of the working
copy until it finds a revision that is either not outgoing (ie already
in the remote) or that is bookmarked.  This means that bookmarks
effectively act as delimiters, and point at the last revision that
will be included in an arc diff.

Test Plan:
[14:40:54 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1226 $ hg log -r '(first(outgoing())^)::' --template='node: {node}\nbookmark: {bookmarks}\n\n' -G
@  node: c8379ef32b0d0e6cf94fe636751ea4fe1353e157
|  bookmark:
|
| o  node: 14f03139049cbda339190b814e52f4ec8b05c431
| |  bookmark: more
| |
| o  node: 6970e9263ab8c6da428420606d1f15c9980da183
| |  bookmark: something
| |
| o  node: 433a93023f03d5f3eddaa243fa973d32a1566aee
|/   bookmark:
|
o  node: f47ccfe34267592dd2e336174a3a311b8783c024
|  bookmark:
|

[14:41:00 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1226 $ ~/devtools/arcanist/bin/arc which --show-base --base 'arc:bookmark'
f47ccfe34267592dd2e336174a3a311b8783c024

[14:41:05 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1226 $ hg up 14f03139049cbda339190b814e52f4ec8b05c431
3 files updated, 0 files merged, 1 files removed, 0 files unresolved

[14:41:10 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1226 $ ~/devtools/arcanist/bin/arc which --show-base --base 'arc:bookmark'
6970e9263ab8c6da428420606d1f15c9980da183

[14:41:14 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1226 $ hg up 6970e9263ab8c6da428420606d1f15c9980da183
0 files updated, 0 files merged, 1 files removed, 0 files unresolved

[14:41:44 Tue Jun 26 2012] dschleimer@dev4022.snc6 ~/hg-dummy
hg-dummy  1227 $ ~/devtools/arcanist/bin/arc which --show-base --base 'arc:bookmark'
f47ccfe34267592dd2e336174a3a311b8783c024

Reviewers: epriestley, bos

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1331

Differential Revision: https://secure.phabricator.com/D2863
2012-06-26 15:04:35 -07:00
vrana
31e36fe3fa Require space after //
Summary:
I use `//~` for marking places which shouldn't be committed.
It also looks ugly.
Maybe it can be just a warning but we provide a patch so error is OK?

Test Plan: New test.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2824
2012-06-26 14:12:17 -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
epriestley
5b1a00eab1 Add various flags to the HgProxy daemons
Summary:
  - Add flags to exit after an idle time or client count.
  - Add flags to control daemonization.
  - Add flags to control output.
  - Add flags to skip the "hello" frame of the protocol.
  - Make the client launch a server if one does not exist.

The one-time overhead to launch a server and run a command through it looks to be ~130% of the overhead to run the command directly with "hg", so even if we never run a second command we're not paying too much.

The incremental overhead to run subsequent command appears to be less than 3% of the overhead to run the command directly with "hg" (and maybe less than 1%, I'm not sure how long the computation part of a command like 'hg log' "actually" takes).

The overhead to launch a PHP client, connect to an existing server, run a command, and then print it and exit is roughly 50% of the overhead to run the command directly with "hg". So theoretically a user can achieve an amortized 2x performance increase for all 'hg' commands by aliasing 'hg' to the PHP client in their shell.

Test Plan:
  - Ran servers with idle and client count limits, let them idle and/or hit their connection limits, saw them exit.
  - Ran foreground and background servers.
  - Ran a daemon server with redirected stdout/stderr. Verified logs appeared.
  - Ran with --quiet.
  - Ran clients and servers with and without --skip-hello, things work if they agree and break if they disagree. The throughput gain on this is fairly small (maybe 5%?) but it seems simple enough to keep for the moment.
  - Ran serverless clients and verified that servers launched the first time, were available subsequently, and relaunched after 15 seconds idle.

Reviewers: csilvers, vrana, btrahan

Reviewed By: csilvers

CC: aran

Differential Revision: https://secure.phabricator.com/D2680
2012-06-26 11:00:26 -07:00
epriestley
69246b282d Simplify "arc branch" and make it work in immutable history repositories
Summary:
  - Move "arc branch"-specific code to the branch workflow.
  - Instead of doing "git rev-parse", just do "git branch --verbose --abbrev=40".
  - Use revision owners to identify ownership, not working copy identity. Particularly with the advent of "Commandeer", you might not own commits you made.
  - Do a batch lookup for commits by hash (depends on D2859, but doesn't break without it).
  - Use PhutilConsole for console stuff.
  - Removed color from "arc list" for the moment.
  - The "--by-status" flag has a slightly different output format now.

Test Plan: Ran "arc branch" in various circumstances, verified it identifies branches in immutable history repositories.

Reviewers: btrahan, vrana, jungejason, nh, slawekbiel

Reviewed By: slawekbiel

CC: aran

Maniphest Tasks: T693

Differential Revision: https://secure.phabricator.com/D2860
2012-06-26 10:50:43 -07:00
dschleimer
acf5350221 [Arcanist] fix scratch dir for svn >= 1.7
Summary:
svn 1.7 got rid of the per-direcotry .svn dirs in favor of a single
.svn directory under the root of the working copy.  Unfortunately, we
relied on ther being a .svn directory at the same level as .arcconfig,
which may or may not be at the root of the working copy.  We now walk
up the directory tree until we find a .svn directory that we can use
for scratch files.

Test Plan:
[16:27:52 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/data/admin/facebook/scripts/db
db  21298 $ ls -la .arcconfig .svn ../../../.svn/arc/config
ls: .svn: No such file or directory
ls: ../../../.svn/arc/config: No such file or directory
-rw-r--r-- 1 dschleimer users 239 Jun 25 16:15 .arcconfig

[16:27:54 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/data/admin/facebook/scripts/db
db  21298 $ ~/devtools/arcanist/bin/arc set-config --local foo bar
Set key 'foo' = 'bar' in local config.

[16:29:40 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/data/admin/facebook/scripts/db
db  21298 $ ls -la .arcconfig .svn ../../../.svn/arc/config
ls: .svn: No such file or directory
-rw-r--r-- 1 dschleimer users 239 Jun 25 16:15 .arcconfig
-rw-r--r-- 1 dschleimer users  20 Jun 25 16:29 ../../../.svn/arc/config

[16:29:43 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/data/admin/facebook/scripts/db
db  21298 $ cat ../../../.svn/arc/config
{
  "foo" : "bar"
}

[16:29:48 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/data/admin/facebook/scripts/db
db  21299 $ ~/devtools/arcanist/bin/arc get-config foo
(global) foo =
(local) foo = bar

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1411

Differential Revision: https://secure.phabricator.com/D2856
2012-06-25 17:13:29 -07:00
dschleimer
82d05fee9f [arcanist] add system arc config file
Summary:
Adds a system arc config file with precedence below the user config
file, both to ArcanistWorkingCopyIdentity::readConfigFromAnySource()
and to base commit resolution.

Test Plan:
[14:48:45 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/devtools/arcanist
arcanist system_config 21245 $ cat /etc/arcconfig
{
    "base": "literal:foobar"
}
[14:52:31 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/devtools/arcanist
arcanist system_config 21246 $ ./bin/arc get-config base
(system) base = literal:foobar
(global) base =

[14:52:39 Mon Jun 25 2012] dschleimer@dev4022.snc6 ~/devtools/arcanist
arcanist system_config 21247 $ ./bin/arc which --show-base --base 'arc:system'
foobar

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2854
2012-06-25 15:14:11 -07:00
Evan Priestley
e1371493be Merge pull request #40 from phleet/patch-2
Fix help message for arc tasks --status
2012-06-25 13:53:00 -07:00
Jamie Wong
356cd860e1 Fix help message for arc tasks --status 2012-06-25 17:46:51 -03:00
vrana
1817f929c2 Introduce arc inlines
Summary: This displays all inline comments attached to a revision in a format consumable by editors.

Test Plan: Ran it, opened the file on the line.

Reviewers: epriestley

Reviewed By: epriestley

CC: vii, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2845
2012-06-23 16:01:38 -07:00
vrana
67c772d919 Warn about PHP 5.3 only functions and parameters
Test Plan:
Linted:

  json_decode('{}', true, 1, 1);
  gethostname();

Also linted all Phabricator repositories and found no occurrence.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1158

Differential Revision: https://secure.phabricator.com/D2806
2012-06-22 15:52:10 -07:00
vrana
1708a03f96 Simplify handling errors in PHPCS linter
Test Plan:
  libxml_use_internal_errors(true);
  $report_dom = new DOMDocument();
  $report_dom->loadXML('<a</a>');
  $report_dom = new DOMDocument();
  $report_dom->loadXML('<a></a>');
  $report_dom = new DOMDocument();
  $report_dom->loadXML('');
  print_r(libxml_get_errors());

Reviewers: aurelijus

Reviewed By: aurelijus

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2816
2012-06-22 14:32:48 -07:00
dschleimer-fb
f931318894 Merge pull request #38 from phleet/patch-1
Fix mixing parens on getWorkingCopyIdentity in ArcanistMercurialAPI
2012-06-22 12:31:15 -07:00
Jamie Wong
e18e4886ba Fix mixing parens on getWorkingCopyIdentity in ArcanistMercurialAPI 2012-06-22 16:25:49 -03:00
vrana
636bcef5ca Save files with path to phutil cache
Test Plan:
  $ arc liberate
  $ mv a.php b.php
  $ arc liberate

Previously, it didn't update the map.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2818
2012-06-22 11:56:54 -07:00
epriestley
887c3484a7 Support 'arc:exec(command)' in base-commit DSL
Summary: Allow users to run a command to determine the base revision of the commit range.

Test Plan: Ran stuff like `arc which --show-base --base 'arc:exec(ls)'` and got the expected results.

Reviewers: dschleimer, csilvers, btrahan, vrana

Reviewed By: csilvers

CC: aran

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2830
2012-06-22 08:13:06 -07:00
dschleimer
7f640b9db9 [Arcanist] mercurial base commit DSL support
Summary:
This adds Mercurial support to the base commit DSL that's equivalent
to git's, though not identical.  Specifically, Mercurial has
arc:outgoing instead of arc:upstream, and hg:gca(commit) instead of
git:merge-base(commit), though they have similar behaviors.

Test Plan:
  [13:37:13 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20536 $ hg log -G -r master::
  @  changeset:   11:6970e9263ab8
  |  bookmark:    something
  |  tag:         tip
  |  user:        David Schleimer <dschleimer@fb.com>
  |  date:        Thu Jun 21 13:03:46 2012 -0700
  |  summary:     thing
  |
  o  changeset:   10:433a93023f03
  |  parent:      8:f47ccfe34267
  |  user:        David Schleimer <dschleimer@fb.com>
  |  date:        Thu Jun 21 13:03:34 2012 -0700
  |  summary:     some
  |
  | o  changeset:   9:c8379ef32b0d
  |/   bookmark:    other
  |    user:        David Schleimer <dschleimer@fb.com>
  |    date:        Thu Jun 21 13:01:04 2012 -0700
  |    summary:     other
  |
  o  changeset:   8:f47ccfe34267
  |  bookmark:    master
  |  user:        David Schleimer <dschleimer@fb.com>
  |  date:        Mon Jun 04 14:30:47 2012 -0700
  |  summary:     typo-fix
  |

  [13:38:00 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20536 $ ~/devtools/arcanist/bin/arc which --show-base --base hg:.^
  .^

  [13:38:11 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20536 $ ~/devtools/arcanist/bin/arc which --show-base --base 'hg:gca(other)'
  f47ccfe34267592dd2e336174a3a311b8783c024

  [13:38:21 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20536 $ hg id -r f47ccfe34267592dd2e336174a3a311b8783c024
  f47ccfe34267 master

  [13:38:31 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20537 $ ~/devtools/arcanist/bin/arc which --show-base --base 'arc:empty'
  null

  [13:38:44 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20538 $ hg id -r null
  000000000000

  [13:38:48 Thu Jun 21 2012] dschleimer@dev4022.snc6 ~/hg-dummy
  hg-dummy  20538 $ ~/devtools/arcanist/bin/arc which --show-base --base 'arc:outgoing'
  f47ccfe34267592dd2e336174a3a311b8783c024

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2822
2012-06-21 18:12:09 -07:00
vrana
a9dbb937e8 Warn about pht() with non constant string
Summary: We will extract them at some point, lint before it's too late.

Test Plan:
New test.
Linted all callsites.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2825
2012-06-21 18:07:13 -07:00
vrana
22d2d6743d Remove bogus warning in liberate 2012-06-21 11:52:16 -07:00
vrana
7f10b43eca Add example to --ansi 2012-06-21 10:32:28 -07:00
vrana
37b494d974 Move line to a better place 2012-06-20 13:03:06 -07:00
epriestley
1d5a2aff20 Allow the "arc land --onto" default to be read from user config
Summary: Allow the default to be set in global config, not just project config.

Test Plan: `arc set-config arc.land.onto.default derp; arc land`

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2686
2012-06-20 12:29:07 -07:00
vrana
a121313ca4 Document --ansi 2012-06-20 12:23:48 -07:00
vrana
fa54b2ea27 Wrap and simplify diff error excuse
Test Plan: Performed a lint error.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2802
2012-06-19 18:18:01 -07:00
vrana
b2bb06ad0c Use pht() for plural 2012-06-19 15:16:52 -07:00
vrana
450433dbae Use new SVN format for all property changes
Test Plan: `svn diff`

Reviewers: nh

Reviewed By: nh

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2799
2012-06-19 14:21:20 -07:00
vrana
23b3dd7e95 Display number of assertions in unit test details
Test Plan: Show Full Unit Results on this diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2777
2012-06-17 13:39:46 -07:00
epriestley
7c3c1e88bd Add test for "static::" to the PHP 5.3 linter
Summary: See https://github.com/facebook/phabricator/issues/133.

Test Plan: Unit tests.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1158

Differential Revision: https://secure.phabricator.com/D2778
2012-06-17 09:01:47 -07:00
epriestley
f2220e74fc Add a DSL for selecting base commits
Summary:
New optional mode. If you set 'base' in local, project or global config or pass '--base' to 'arc diff' or 'arc which', it switches to DSL mode.

In DSL mode, lists of rules from args, local, project and global config are resolved, in that order. Rules can manipulate the rule machine or resolve into actual commits. Provides support for some 'arc' rules (mostly machine manipulation) and 'git' rules (symbolic ref and merge-base).

Test Plan:
Ran unit tests. Also:

```$ arc which --show-base --base 'arc:prompt'

    Against which commit? HEAD
HEAD
$ arc which --show-base --base 'git:HEAD'
HEAD
$ arc which --show-base --base 'git:fake'
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.
$ arc which --show-base --base 'git:origin/master'
origin/master
$ arc which --show-base --base 'git:upstream'
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.
$ arc which --show-base --base 'literal:derp'
derp
$ arc which --show-base --base 'arc:halt'
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.
$ arc set-config --local base git:origin/master
Set key 'base' = 'git:origin/master' in local config.
$ arc which --show-base
origin/master
$ arc which --show-base --base 'git:HEAD^'
HEAD^
$ arc which --show-base --base 'arc:yield, git:HEAD^'
origin/master
$ arc which --show-base --base 'arc:global, git:HEAD^'
HEAD^
$ arc which --show-base --base 'arc:global, git:merge-base(origin/master)'
3f4f8992fba8d1f142974da36a82bae900e247c0```

Reviewers: dschleimer, vrana

Reviewed By: dschleimer

CC: aran

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2748
2012-06-15 14:01:28 -07:00