]> khamidou — GitHub mirrors - arcanist.git/commit
Implement "arc:amended" and fix various problems with ArcanistMercurialAPI
authorepriestley <git@epriestley.com>
Sun, 1 Jul 2012 18:06:05 +0000 (11:06 -0700)
committerepriestley <git@epriestley.com>
Sun, 1 Jul 2012 18:06:05 +0000 (11:06 -0700)
commit563230b0fbd4e7a46528e1e9da7e42f0d8ea20a2
treebb8b9694e4ca5e3e7f9e9d6dff1893be6f9a3bbe
parent470e2eca67d2b1dda701886c113125d7394675b0
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
src/parser/ArcanistBaseCommitParser.php
src/repository/api/ArcanistGitAPI.php
src/repository/api/ArcanistMercurialAPI.php
src/repository/api/ArcanistRepositoryAPI.php
src/workflow/ArcanistDiffWorkflow.php