implement disable last commit for mercurial browse command

This commit is contained in:
Sebastian Sdorra
2013-01-18 21:11:25 +01:00
parent e8ebf7091d
commit da52e76ac7
4 changed files with 123 additions and 35 deletions

View File

@@ -94,6 +94,11 @@ public class HgBrowseCommand extends AbstractCommand implements BrowseCommand
cmd.path(request.getPath());
}
if (request.isDisableLastCommit())
{
cmd.disableLastCommit();
}
BrowserResult result = new BrowserResult();
result.setFiles(cmd.execute());

View File

@@ -85,6 +85,20 @@ public class HgFileviewCommand extends AbstractCommand
return new HgFileviewCommand(repository);
}
/**
* Method description
*
*
* @return
*/
public HgFileviewCommand disableLastCommit()
{
disableLastCommit = true;
cmdAppend("-d");
return this;
}
/**
* Method description
*
@@ -217,9 +231,13 @@ public class HgFileviewCommand extends AbstractCommand
file.setLength(stream.decimalIntUpTo(' '));
DateTime timestamp = stream.dateTimeUpTo(' ');
String description = stream.textUpTo('\0');
file.setLastModified(timestamp.getDate().getTime());
file.setDescription(stream.textUpTo('\0'));
if (!disableLastCommit)
{
file.setLastModified(timestamp.getDate().getTime());
file.setDescription(description);
}
return file;
}
@@ -297,4 +315,9 @@ public class HgFileviewCommand extends AbstractCommand
return path;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
private boolean disableLastCommit = false;
}