mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Display base correctly for git-svn in update history
Summary: for a git repo which is using git-svn, we should show the revisioni number. For example, it is show "svn+ssh" if the git url starts with "svn+ssh". Show the svn revision number instead. Before fix: https://secure.phabricator.com/file/view/PHID-FILE-j5rogyqjkgifoxtpwzcu/ After fix: https://secure.phabricator.com/file/view/PHID-FILE-4vsnptcjzuzuyj4zo25x/ Test Plan: - verified a diff with git-svn worked - verified a pure git diff still worked Reviewers: epriestley, nh Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1344
This commit is contained in:
parent
79205481e6
commit
79d6d252b7
1 changed files with 11 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -308,11 +308,19 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
private function renderBaseRevision(DifferentialDiff $diff) {
|
||||
switch ($diff->getSourceControlSystem()) {
|
||||
case 'git':
|
||||
return substr($diff->getSourceControlBaseRevision(), 0, 7);
|
||||
$base = $diff->getSourceControlBaseRevision();
|
||||
if (strpos($base, '@') === false) {
|
||||
return substr($base, 0, 7);
|
||||
} else {
|
||||
// The diff is from git-svn
|
||||
$base = explode('@', $base);
|
||||
$base = last($base);
|
||||
return $base;
|
||||
}
|
||||
case 'svn':
|
||||
$base = $diff->getSourceControlBaseRevision();
|
||||
$base = explode('@', $base);
|
||||
$base = end($base);
|
||||
$base = last($base);
|
||||
return $base;
|
||||
default:
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue