Skip to content

Commit aeb0b34

Browse files
author
Vladimir Kotal
committed
follow renamed file handling property
fixes #2154
1 parent 2d1657b commit aeb0b34

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/org/opensolaris/opengrok/history/MercurialRepository.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ Executor getHistoryLogExecutor(File file, String sinceRevision)
182182
// Due to behavior of recent Mercurial versions, it is not possible
183183
// to filter the changesets of a file based on revision.
184184
// For files this does not matter since if getHistory() is called
185-
// for a file, the file has to be renamed so we want its complete history.
186-
cmd.add("--follow");
185+
// for a file, the file has to be renamed so we want its complete history
186+
// if renamed file handling is enabled for this repository.
187+
if (this.isHandleRenamedFiles()) {
188+
cmd.add("--follow");
189+
}
187190
}
188191

189192
cmd.add("--template");
@@ -408,6 +411,9 @@ public Annotation annotate(File file, String revision) throws IOException {
408411
argv.add(RepoCommand);
409412
argv.add("annotate");
410413
argv.add("-n");
414+
if (!this.isHandleRenamedFiles()) {
415+
argv.add("--no-follow");
416+
}
411417
if (revision != null) {
412418
argv.add("-r");
413419
if (revision.indexOf(':') == -1) {

0 commit comments

Comments
 (0)