Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15317728
D7730.id17509.diff
No One
Temporary
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
D7730.id17509.diff
View Options
Index: src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
===================================================================
--- src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
+++ src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
@@ -3,23 +3,7 @@
final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
protected function executeQuery() {
- $raw_diff = $this->executeRawDiffCommand();
-
- // the only legitimate case here is if we are looking at the first commit
- // in the repository. no parents means first commit.
- if (!$raw_diff) {
- $drequest = $this->getRequest();
- $parent_query =
- DiffusionCommitParentsQuery::newFromDiffusionRequest($drequest);
- $parents = $parent_query->loadParents();
- if ($parents === array()) {
- // mercurial likes the string null here
- $this->setAgainstCommit('null');
- $raw_diff = $this->executeRawDiffCommand();
- }
- }
-
- return $raw_diff;
+ return $this->executeRawDiffCommand();
}
@@ -34,11 +18,14 @@
$against = $this->getAgainstCommit();
if ($against === null) {
- $against = $commit.'^';
+ // If `$commit` has no parents (usually because it's the first commit
+ // in the repository), we want to diff against `null`. This revset will
+ // do that for us automatically.
+ $against = '('.$commit.'^ or null)';
}
$future = $repository->getLocalCommandFuture(
- 'diff -U %d --git --rev %s:%s -- %s',
+ 'diff -U %d --git --rev %s --rev %s -- %s',
$this->getLinesOfContext(),
$against,
$commit,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 7:48 PM (1 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7346341
Default Alt Text
D7730.id17509.diff (1 KB)
Attached To
Mode
D7730: Fix the exception when watching the first commit of a mercurial repo
Attached
Detach File
Event Timeline
Log In to Comment