mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
implement disable last commit for mercurial browse command
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user