comparison src/org/tmatesoft/hg/core/LogCommand.java @ 77:c677e1593919

Moved RevlogStream implementation into .internal
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 24 Jan 2011 05:33:47 +0100
parents 6f1b88693d48
children 4222b04f34ee
comparison
equal deleted inserted replaced
76:658fa6b3a371 77:c677e1593919
48 private Set<String> branches; 48 private Set<String> branches;
49 private int limit = 0, count = 0; 49 private int limit = 0, count = 0;
50 private int startRev = 0, endRev = TIP; 50 private int startRev = 0, endRev = TIP;
51 private Handler delegate; 51 private Handler delegate;
52 private Calendar date; 52 private Calendar date;
53 private Path file;
53 private Cset changeset; 54 private Cset changeset;
54 55
55 public LogCommand(HgRepository hgRepo) { 56 public LogCommand(HgRepository hgRepo) {
56 this.repo = hgRepo; 57 this.repo = hgRepo;
57 } 58 }
127 endRev = rev2; 128 endRev = rev2;
128 } 129 }
129 return this; 130 return this;
130 } 131 }
131 132
132 // multiple? Bad idea, would need to include extra method into Handler to tell start of next file 133 /**
134 * Visit history of a given file only.
135 * @param file path relative to repository root. Pass <code>null</code> to reset.
136 */
133 public LogCommand file(Path file) { 137 public LogCommand file(Path file) {
138 // multiple? Bad idea, would need to include extra method into Handler to tell start of next file
134 // implicit --follow in this case 139 // implicit --follow in this case
135 throw HgRepository.notImplemented(); 140 this.file = file;
141 return this;
136 } 142 }
137 143
138 /** 144 /**
139 * Similar to {@link #execute(org.tmatesoft.hg.repo.Changeset.Inspector)}, collects and return result as a list. 145 * Similar to {@link #execute(org.tmatesoft.hg.repo.Changeset.Inspector)}, collects and return result as a list.
140 */ 146 */
159 } 165 }
160 try { 166 try {
161 delegate = handler; 167 delegate = handler;
162 count = 0; 168 count = 0;
163 changeset = new Cset(new StatusCollector(repo), new PathPool(repo.getPathHelper())); 169 changeset = new Cset(new StatusCollector(repo), new PathPool(repo.getPathHelper()));
164 repo.getChangelog().range(startRev, endRev, this); 170 if (file == null) {
171 repo.getChangelog().range(startRev, endRev, this);
172 } else {
173 repo.getFileNode(file).history(startRev, endRev, this);
174 }
165 } finally { 175 } finally {
166 delegate = null; 176 delegate = null;
167 changeset = null; 177 changeset = null;
168 } 178 }
169 } 179 }