Lines 122-128
Link Here
|
122 |
private static final String HG_REMOVE_FLAG_FORCE_CMD = "--force"; // NOI18N |
122 |
private static final String HG_REMOVE_FLAG_FORCE_CMD = "--force"; // NOI18N |
123 |
|
123 |
|
124 |
private static final String HG_LOG_CMD = "log"; // NOI18N |
124 |
private static final String HG_LOG_CMD = "log"; // NOI18N |
125 |
private static final String HG_LOG_LIMIT_CMD = "-l 1"; // NOI18N |
125 |
private static final String HG_LOG_LIMIT_ONE_CMD = "-l 1"; // NOI18N |
|
|
126 |
private static final String HG_LOG_LIMIT_CMD = "-l"; // NOI18N |
126 |
private static final String HG_LOG_TEMPLATE_SHORT_CMD = "--template={rev}\\n{desc|firstline}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N |
127 |
private static final String HG_LOG_TEMPLATE_SHORT_CMD = "--template={rev}\\n{desc|firstline}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N |
127 |
private static final String HG_LOG_TEMPLATE_LONG_CMD = "--template={rev}\\n{desc}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N |
128 |
private static final String HG_LOG_TEMPLATE_LONG_CMD = "--template={rev}\\n{desc}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N |
128 |
private static final String HG_CSET_TEMPLATE_CMD = "--template={rev}:{node|short}\\n"; // NOI18N |
129 |
private static final String HG_CSET_TEMPLATE_CMD = "--template={rev}:{node|short}\\n"; // NOI18N |
Lines 608-614
Link Here
|
608 |
|
609 |
|
609 |
command.add(getHgCommand()); |
610 |
command.add(getHgCommand()); |
610 |
command.add(HG_LOG_CMD); |
611 |
command.add(HG_LOG_CMD); |
611 |
command.add(HG_LOG_LIMIT_CMD); |
612 |
command.add(HG_LOG_LIMIT_ONE_CMD); |
612 |
command.add(HG_OPT_REPOSITORY); |
613 |
command.add(HG_OPT_REPOSITORY); |
613 |
command.add(repository.getAbsolutePath()); |
614 |
command.add(repository.getAbsolutePath()); |
614 |
|
615 |
|
Lines 1197-1211
Link Here
|
1197 |
* |
1198 |
* |
1198 |
* @param File repository of the mercurial repository's root directory |
1199 |
* @param File repository of the mercurial repository's root directory |
1199 |
* @param files to query revisions for |
1200 |
* @param files to query revisions for |
|
|
1201 |
* @param Int limit on nunmber of revisions (-1 for no limit) |
1200 |
* @return List<String> list of the revisions of the file - {<rev>:<short cset hash>} |
1202 |
* @return List<String> list of the revisions of the file - {<rev>:<short cset hash>} |
1201 |
* or null if no commits made yet. |
1203 |
* or null if no commits made yet. |
1202 |
*/ |
1204 |
*/ |
1203 |
public static List<String> getAllRevisionsForFile(File repository, File[] files) { |
1205 |
public static List<String> getRevisionsForFile(File repository, File[] files, int limit) { |
1204 |
if (repository == null) return null; |
1206 |
if (repository == null) return null; |
1205 |
List<String> command = new ArrayList<String>(); |
1207 |
List<String> command = new ArrayList<String>(); |
1206 |
|
1208 |
|
1207 |
command.add(getHgCommand()); |
1209 |
command.add(getHgCommand()); |
1208 |
command.add(HG_LOG_CMD); |
1210 |
command.add(HG_LOG_CMD); |
|
|
1211 |
if (limit >= 0) { |
1212 |
command.add(HG_LOG_LIMIT_CMD); |
1213 |
command.add(Integer.toString(limit)); |
1214 |
} |
1209 |
command.add(HG_OPT_REPOSITORY); |
1215 |
command.add(HG_OPT_REPOSITORY); |
1210 |
command.add(repository.getAbsolutePath()); |
1216 |
command.add(repository.getAbsolutePath()); |
1211 |
command.add(HG_CSET_TARGET_TEMPLATE_CMD); |
1217 |
command.add(HG_CSET_TARGET_TEMPLATE_CMD); |
Lines 1225-1239
Link Here
|
1225 |
} |
1231 |
} |
1226 |
|
1232 |
|
1227 |
/** |
1233 |
/** |
1228 |
* Get all the revisions for a repository |
1234 |
* Get the revisions for a repository |
1229 |
* |
1235 |
* |
1230 |
* @param File repository of the mercurial repository's root directory |
1236 |
* @param File repository of the mercurial repository's root directory |
1231 |
* @return List<String> list of the revisions of the repository - {<rev>:<short cset hash>} |
1237 |
* @return List<String> list of the revisions of the repository - {<rev>:<short cset hash>} |
1232 |
* or null if no commits made yet. |
1238 |
* or null if no commits made yet. |
1233 |
*/ |
1239 |
*/ |
1234 |
public static List<String> getAllRevisions(File repository) { |
1240 |
public static List<String> getRevisions(File repository, int limit) { |
1235 |
if (repository == null) return null; |
1241 |
if (repository == null) return null; |
1236 |
return getAllRevisionsForFile(repository, null); |
1242 |
return getRevisionsForFile(repository, null, limit); |
1237 |
} |
1243 |
} |
1238 |
|
1244 |
|
1239 |
/** |
1245 |
/** |
Lines 1470-1476
Link Here
|
1470 |
|
1476 |
|
1471 |
command.add(getHgCommand()); |
1477 |
command.add(getHgCommand()); |
1472 |
command.add(HG_LOG_CMD); |
1478 |
command.add(HG_LOG_CMD); |
1473 |
command.add(HG_LOG_LIMIT_CMD); |
1479 |
command.add(HG_LOG_LIMIT_ONE_CMD); |
1474 |
command.add(HG_OPT_REPOSITORY); |
1480 |
command.add(HG_OPT_REPOSITORY); |
1475 |
command.add(repository.getAbsolutePath()); |
1481 |
command.add(repository.getAbsolutePath()); |
1476 |
command.add(template); |
1482 |
command.add(template); |