Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F92677
D7817.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7817.diff
View Options
diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -583,17 +583,22 @@
// Resolve all of the futures now. We don't need the 'commits' future yet,
// but it simplifies the logic to just get it out of the way.
foreach (Futures($futures) as $future) {
- $future->resolvex();
+ $future->resolve();
}
list($commit_raw) = $futures['commits']->resolvex();
$commit_map = $this->parseMercurialCommits($commit_raw);
$this->mercurialCommits = $commit_map;
- list($old_raw) = $futures['old']->resolvex();
+ // NOTE: `hg heads` exits with an error code and no output if the repository
+ // has no heads. Most commonly this happens on a new repository. We know
+ // we can run `hg` successfully since the `hg log` above didn't error, so
+ // just ignore the error code.
+
+ list($err, $old_raw) = $futures['old']->resolve();
$old_refs = $this->parseMercurialHeads($old_raw);
- list($new_raw) = $futures['new']->resolvex();
+ list($err, $new_raw) = $futures['new']->resolve();
$new_refs = $this->parseMercurialHeads($new_raw);
$all_refs = array_keys($old_refs + $new_refs);
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/lx/xx/zonjxjcnnix7sem7
Default Alt Text
D7817.diff (1 KB)
Attached To
Mode
D7817: Fix a commit hook issue with the initial commit to Mercurial repositories
Attached
Detach File
Event Timeline
Log In to Comment