Mercurial > hg4j
annotate src/org/tmatesoft/hg/internal/diff/LineImpl.java @ 713:661e77dc88ba tip
Mac support: respect Mac alternatives of command-line arguments for common unix tools
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sun, 03 Aug 2014 18:09:00 +0200 |
parents | 7839ff0bfd78 |
children |
rev | line source |
---|---|
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013 TMate Software Ltd |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
703
7839ff0bfd78
Refactor: move diff/blame related code to a separate package
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
677
diff
changeset
|
17 package org.tmatesoft.hg.internal.diff; |
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 import org.tmatesoft.hg.core.HgAnnotateCommand.LineInfo; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 /** |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 * @author Artem Tikhomirov |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 * @author TMate Software Ltd. |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 */ |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 final class LineImpl implements LineInfo { |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 private int ln; |
677
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
27 private int origLine; |
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 private int rev; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 private byte[] content; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 |
677
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
31 void init(int line, int firstAppearance, int csetRev, byte[] cnt) { |
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 ln = line; |
677
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
33 origLine = firstAppearance; |
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 rev = csetRev; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 content = cnt; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 } |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 public int getLineNumber() { |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
39 return ln; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
40 } |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
41 |
677
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
42 |
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
43 public int getOriginLineNumber() { |
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
44 return origLine; |
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
45 } |
1c49c0cee540
Report line number at the first appearance, like 'hg annotate -l' does
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
676
diff
changeset
|
46 |
676
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
47 public int getChangesetIndex() { |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
48 return rev; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
49 } |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
50 |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
51 public byte[] getContent() { |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
52 return content; |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
53 } |
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
54 } |