]> khamidou — GitHub mirrors - arcanist.git/commit
Arc - add a sanity check to arc patch workflows to make sure the vcs base
authorBob Trahan <bob.trahan@gmail.com>
Sat, 3 Dec 2011 00:21:14 +0000 (16:21 -0800)
committerBob Trahan <bob.trahan@gmail.com>
Tue, 10 Jan 2012 19:48:05 +0000 (11:48 -0800)
commitb61e4eacf1d4097a270a285eca87778156d1f194
treef927be771f046e51d38c34eaa3e9771d24077989
parentf3eccfbe81f1a6ae4a6755d10fdc42c632b96327
Arc - add a sanity check to arc patch workflows to make sure the vcs base
revision is the correct base revision relative to the patch.

Summary: What the title says.   If not correct, warn the user.   This check
honors the --force flag to skip all these checks.   This change also includes
moving some Differential constants into Arc so they can be used for both
projects.   There is a corresponding phabricator diff (incoming) to address this
part of the change.

Test Plan:
For a project with actual diffs, a git repository tracked by phabricator, *AND*
development in master branch only, do some...
- git reset --hard HEAD^1
- arc patch DX, where X is what got us to HEAD in the first place
- verify successful patch
...then...
- git reset --hard HEAD^^
- arc patch DX, where X is what got us to HEAD in the first place
- verify warning
- verify Y versus N continues versus stops appropriately
Note if development were done outside the master branch this warning message
will fire early / often as git commit hashes are based on the commit *and* the
rest of the source code the commit is made against.  This is (unfortunately) the
"typical" case so this warning is pretty active at the moment.   T201 will
eventually land and when parsing a given commit update the corresponding diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, btrahan, epriestley
Differential Revision: https://secure.phabricator.com/D1328
14 files changed:
src/__phutil_library_map__.php
src/differential/constants/revisionhash/ArcanistDifferentialRevisionHash.php [new file with mode: 0644]
src/differential/constants/revisionhash/__init__.php [new file with mode: 0644]
src/differential/constants/revisionstatus/ArcanistDifferentialRevisionStatus.php [new file with mode: 0644]
src/differential/constants/revisionstatus/__init__.php [new file with mode: 0644]
src/parser/bundle/ArcanistBundle.php
src/repository/api/base/ArcanistRepositoryAPI.php
src/repository/api/git/ArcanistGitAPI.php
src/repository/api/mercurial/ArcanistMercurialAPI.php
src/repository/api/subversion/ArcanistSubversionAPI.php
src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/export/ArcanistExportWorkflow.php
src/workflow/patch/ArcanistPatchWorkflow.php
src/workflow/patch/__init__.php