Phabricator/FAQ: Difference between revisions

no edit summary
No edit summary
Line 34: Line 34:
=== Can I remove "Tags: #secure-revision" from my changeset’s commit message? ===
=== Can I remove "Tags: #secure-revision" from my changeset’s commit message? ===


"#secure-revision" is a project tag attached to the revision at the time the commit message is auto-generated. The tag is removed slightly later once Bugzilla has had a chance to update the revisions security policies.  After Bugzilla has done this update, you can use "arc amend" to update the commit message with the current state. We are currently working on a custom client that may omit the project tags from the commit message altogether.
"#secure-revision" is a project tag attached to the revision at the time the commit message is auto-generated. The tag is removed slightly later once Bugzilla has had a chance to update the revisions security policies.  After Bugzilla has done this update, you can use <code>arc amend</code> to update the commit message with the current state.
 
Note using <code>moz-phab</code> instead of <code>arc</code> to submit changesets to Phabricator will avoid this issue.


=== Can I close multiple revisions with one commit message? (by including multiple “Differential Revision:” lines?) ===
=== Can I close multiple revisions with one commit message? (by including multiple “Differential Revision:” lines?) ===
Line 50: Line 52:
[[File:Closed revision actions.png|320px|Closed revision actions]]
[[File:Closed revision actions.png|320px|Closed revision actions]]


Note that you will need to run "arc diff" again to update the patch even if you don't need to change it (e.g. the bustage was in an earlier commit).  This is because Phabricator updates the revision after it lands but does not provide the necessary metadata that Lando needs.  See {{bug|1489126}}.
Note that you will need to run <code>arc diff</code> again to update the patch even if you don't need to change it (e.g. the bustage was in an earlier commit).  This is because Phabricator updates the revision after it lands but does not provide the necessary metadata that Lando needs.  See {{bug|1489126}}.


See also https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#other-revision-actions for descriptions of other non-review-related actions you might want to take on a revision.
See also https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#other-revision-actions for descriptions of other non-review-related actions you might want to take on a revision.
Line 57: Line 59:
=== How do I keep the original commit author when commandeering someone else's revision? ===
=== How do I keep the original commit author when commandeering someone else's revision? ===


Use '''hg commit --amend --user "Other Person <person@mozilla.com>"''' or '''git commit --amend --author="Other Person <person@mozilla.com>"''' when amending the original commit.
Use <code>hg commit --amend --user "Other Person <person@mozilla.com>"</code> or <code>git commit --amend --author="Other Person <person@mozilla.com>"</code> when amending the original commit.


=== How do I download the patch or a file from Phabricator and apply it locally? ===
=== How do I download the patch or a file from Phabricator and apply it locally? ===


* Use the '''arc patch''' command to download and apply a diff:
* Use the <code>moz-phab patch</code> command to download an apply a diff (recommended)
[[File:Arc patch.png|320px|Arc Patch]]
 
* Use the <code>arc patch</code> command to download and apply a diff


* Manually download just the diff from the menu on the right side of the page:
* Manually download just the diff from the menu on the right side of the page:
Line 105: Line 108:
=== How do I get “arc diff” to stop listing and asking about all my untracked build artifacts? ===
=== How do I get “arc diff” to stop listing and asking about all my untracked build artifacts? ===


Use the --allow-untracked” option to arc diff.
Use the <code>--allow-untracked</code> option to arc diff.


=== How do I fetch and apply changes to a local repository? ===
=== How do I fetch and apply changes to a local repository? ===
Line 111: Line 114:
==== Using moz-phab (recommended) ====
==== Using moz-phab (recommended) ====


Use <code>moz-phab patch ''revision-id''</code> command to download and apply stacks of Phabricator revisions.
Use <code>moz-phab patch ''D<NNNNN>''</code> command to download and apply stacks of Phabricator revisions.


Execute <code>moz-phab patch --help</code> for information on how to change patch's behaviour.
Execute <code>moz-phab patch --help</code> for information on how to change patch's behaviour.
Line 121: Line 124:
correctly, and the first revision in the related revision chain has a parent
correctly, and the first revision in the related revision chain has a parent
commit hash corresponding to a base revision existing in the local mercurial
commit hash corresponding to a base revision existing in the local mercurial
repository, "arc patch --revision D<NNNNN>" should apply the series to the
repository, <code>arc patch --revision ''D<NNNNN>''</code> should apply the series to the
appropriate base revision.
appropriate base revision.


Line 130: Line 133:
# Look through the history of the revision to find changes to the parent revision and guess which was the parent revision at the time the diff was generated from a commit.  Changes to parent revisions are manual and so may happen before or after the commit was pushed (if they were accurate at any stage).
# Look through the history of the revision to find changes to the parent revision and guess which was the parent revision at the time the diff was generated from a commit.  Changes to parent revisions are manual and so may happen before or after the commit was pushed (if they were accurate at any stage).
# Repeat the process to find a diff ID in the parent revision, and continue until there are no parent revisions.  When viewing a particular diff ID, the "Commits" tab will have a commit hash and parent commit hash, if the diff was submitted from moz-phab at least.  These may be useful in identifying parent revisions and diffs.
# Repeat the process to find a diff ID in the parent revision, and continue until there are no parent revisions.  When viewing a particular diff ID, the "Commits" tab will have a commit hash and parent commit hash, if the diff was submitted from moz-phab at least.  These may be useful in identifying parent revisions and diffs.
# "arc patch --diff <NNNNN>" may be used to create a commit for the first diff in the series.
# <code>arc patch --diff ''<NNNNN>''</code> may be used to create a commit for the first diff in the series.
# For each subsequent diff use "arc patch --skip-dependencies --diff <NNNNN>". "--skip-dependencies" prevents more recent diffs for parent revisions or diffs for wrong parent revisions being fetched and prevents attempts to apply the specified diff on these incorrect diffs ([https://bugzilla.mozilla.org/show_bug.cgi?id=1485849 Tracked in bug 1485849])
# For each subsequent diff use <code>arc patch --skip-dependencies --diff ''<NNNNN>''</code>. <code>--skip-dependencies</code> prevents more recent diffs for parent revisions or diffs for wrong parent revisions being fetched and prevents attempts to apply the specified diff on these incorrect diffs ([https://bugzilla.mozilla.org/show_bug.cgi?id=1485849 Tracked in bug 1485849])


=== How do I get "arc patch" to apply changes to local tip instead of branching an earlier commit? ===
=== How do I get "arc patch" to apply changes to local tip instead of branching an earlier commit? ===


Use "arc patch --nobranch [rest of command]".  The changes will be applied to the appropriate earlier commit, if known, and rebased.
Use <code>arc patch --nobranch [rest of command]</code>.  The changes will be applied to the appropriate earlier commit, if known, and rebased.


=== The official docs on installing Arcanist on Windows are ... not great. Are there better ones somewhere? ===
=== The official docs on installing Arcanist on Windows are ... not great. Are there better ones somewhere? ===
Line 143: Line 146:
=== arc dies when I do [X]!  How do I get debug information out of arc? ===
=== arc dies when I do [X]!  How do I get debug information out of arc? ===


Run "arc --trace [rest of command]".  You will get a lot of diagnostic information.
Run <code>arc --trace [rest of command]</code>.  You will get a lot of diagnostic information.


If you've found a bug you can file it under the [https://bugzilla.mozilla.org/enter_bug.cgi?product=Conduit&component=Phabricator Phabricator component] in BMO.
If you've found a bug you can file it under the [https://bugzilla.mozilla.org/enter_bug.cgi?product=Conduit&component=Phabricator Phabricator component] in BMO.
Line 212: Line 215:


* '''The revision was created via arcanist or moz-phab, but the error still appears.'''
* '''The revision was created via arcanist or moz-phab, but the error still appears.'''
** This can happen if you have not set an author email in your '''.hgrc''' file (or [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup git config]).  Set your author email in your '''.hgrc''' to your username, '''Firstname Lastname <yourldapemail@mozilla.com>'''. Update your commit so it contains the new author data. Re-run '''arc diff''' so that the new commit+data is uploaded to Phabricator.
** This can happen if you have not set an author email in your <code>.hgrc</code> file (or [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup git config]).  Set your author email in your <code>.hgrc</code> to your username, <code>Firstname Lastname <yourldapemail@mozilla.com></code>. Update your commit so it contains the new author data. Re-run <code>moz-phab submit</code> or <code>arc diff</code> so that the new commit+data is uploaded to Phabricator.


* '''You are attempting to re-land a revision but [https://bugzilla.mozilla.org/show_bug.cgi?id=1489126 Bug 1489126] happens'''
* '''You are attempting to re-land a revision but [https://bugzilla.mozilla.org/show_bug.cgi?id=1489126 Bug 1489126] happens'''
Confirmed users
1,198

edits