Skip to content

Commit b776e30

Browse files
committed
HgWeb: fix PHP notices when importing repository
Fixes #249
1 parent 39a4dbe commit b776e30

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

SourceHgWeb/SourceHgWeb.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) {
241241
if( strpos( $t_line, '#' ) === 0 ) {
242242
if( !isset( $t_commit['revision'] ) && preg_match( '@^# Node ID +([a-f0-9]+)@', $t_line, $t_matches ) ) {
243243
$t_commit['revision'] = $t_matches[1];
244-
echo 'Processing ' . string_display_line( $t_commit[revision] ) . '... ';
244+
echo 'Processing ' . string_display_line( $t_commit['revision'] ) . '... ';
245245
if ( SourceChangeset::exists( $p_repo->id, $t_commit['revision'] ) ) {
246246
echo "already exists.\n";
247247
return array( null, array() );
@@ -285,21 +285,21 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) {
285285
$t_file['revision'] = $t_commit['revision'];
286286

287287
if(!empty($t_file_matches[3])) {
288-
if(!empty($t_file_matches[5])) {
289-
$t_file['action'] = 'bin';
288+
if (empty($t_file_matches[5]) && empty($t_file_matches[6]) && empty($t_file_matches[7])) {
289+
$t_file['action'] = 'mod';
290290
}
291-
else if ("/dev/null" == $t_file_matches[7]) {
292-
$t_file['action'] = 'rm';
291+
else if(!empty($t_file_matches[5])) {
292+
$t_file['action'] = 'bin';
293293
}
294294
else if ("/dev/null" == $t_file_matches[6]) {
295295
$t_file['action'] = 'add';
296296
}
297+
else if ("/dev/null" == $t_file_matches[7]) {
298+
$t_file['action'] = 'rm';
299+
}
297300
else if ("/dev/null" == $t_file_matches[7] && "/dev/null" == $t_file_matches[6]) {
298301
$t_file['action'] = 'n/a';
299302
}
300-
else if (empty($t_file_matches[5]) && empty($t_file_matches[6]) && empty($t_file_matches[7])) {
301-
$t_file['action'] = 'mod';
302-
}
303303
}
304304
$t_commit['files'][] = $t_file;
305305
}

0 commit comments

Comments
 (0)