Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14394742
D15472.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D15472.id.diff
View Options
diff --git a/src/workflow/ArcanistWhichWorkflow.php b/src/workflow/ArcanistWhichWorkflow.php
--- a/src/workflow/ArcanistWhichWorkflow.php
+++ b/src/workflow/ArcanistWhichWorkflow.php
@@ -259,7 +259,7 @@
$console = PhutilConsole::getConsole();
$console->writeOut("**%s**\n", pht('REPOSITORY'));
- $callsign = $this->getRepositoryCallsign();
+ $repo_name = $this->getRepositoryName();
$console->writeOut(
"%s\n\n",
@@ -272,11 +272,11 @@
$console->writeOut("%s\n\n", $reason);
}
- if ($callsign) {
+ if ($repo_name) {
$console->writeOut(
"%s\n",
pht('This working copy is associated with the %s repository.',
- phutil_console_format('**%s**', $callsign)));
+ phutil_console_format('**%s**', $repo_name)));
} else {
$console->writeOut(
"%s\n",
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -1107,8 +1107,17 @@
// Don't amend the current commit if it has already been published.
$repository = $this->loadProjectRepository();
if ($repository) {
- $callsign = $repository['callsign'];
- $commit_name = 'r'.$callsign.$commit['commit'];
+ $repo_id = $repository['id'];
+ $commit_hash = $commit['commit'];
+ $callsign = idx($repository, 'callsign');
+ if ($callsign) {
+ // The server might be too old to support the new style commit names,
+ // so prefer the old way
+ $commit_name = "r{$callsign}{$commit_hash}";
+ } else {
+ $commit_name = "R{$repo_id}:{$commit_hash}";
+ }
+
$result = $this->getConduit()->callMethodSynchronous(
'diffusion.querycommits',
array('names' => array($commit_name)));
@@ -1686,18 +1695,17 @@
return idx($this->getRepositoryInformation(), 'phid');
}
-
/**
- * Get the callsign of the Phabricator repository this working copy
+ * Get the name of the Phabricator repository this working copy
* corresponds to. Returns `null` if no repository can be identified.
*
- * @return string|null Repository callsign, or null if no repository can be
+ * @return string|null Repository name, or null if no repository can be
* identified.
*
* @task phabrep
*/
- final protected function getRepositoryCallsign() {
- return idx($this->getRepositoryInformation(), 'callsign');
+ final protected function getRepositoryName() {
+ return idx($this->getRepositoryInformation(), 'name');
}
@@ -2013,12 +2021,12 @@
// If we know which repository we're in, try to tell Phabricator that we
// pushed commits to it so it can update. This hint can help pull updates
// more quickly, especially in rarely-used repositories.
- if ($this->getRepositoryCallsign()) {
+ if ($this->getRepositoryPHID()) {
try {
$this->getConduit()->callMethodSynchronous(
'diffusion.looksoon',
array(
- 'callsigns' => array($this->getRepositoryCallsign()),
+ 'repositories' => array($this->getRepositoryPHID()),
));
} catch (ConduitClientException $ex) {
// If we hit an exception, just ignore it. Likely, we are running
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 2:27 AM (13 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6920283
Default Alt Text
D15472.id.diff (3 KB)
Attached To
Mode
D15472: Make callsigns optional in arcanist
Attached
Detach File
Event Timeline
Log In to Comment