mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
improve changeset viewer
This commit is contained in:
@@ -164,30 +164,17 @@ public class GitChangesetViewer implements ChangesetViewer
|
|||||||
switch (entry.getChangeType())
|
switch (entry.getChangeType())
|
||||||
{
|
{
|
||||||
case ADD :
|
case ADD :
|
||||||
if (modifications.getAdded() == null)
|
|
||||||
{
|
|
||||||
modifications.setAdded(new ArrayList<String>());
|
|
||||||
}
|
|
||||||
|
|
||||||
modifications.getAdded().add(entry.getNewPath());
|
modifications.getAdded().add(entry.getNewPath());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODIFY :
|
case MODIFY :
|
||||||
if (modifications.getModified() == null)
|
|
||||||
{
|
|
||||||
modifications.setModified(new ArrayList<String>());
|
|
||||||
}
|
|
||||||
|
|
||||||
modifications.getModified().add(entry.getNewPath());
|
modifications.getModified().add(entry.getNewPath());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DELETE :
|
case DELETE :
|
||||||
if (modifications.getRemoved() == null)
|
|
||||||
{
|
|
||||||
modifications.setRemoved(new ArrayList<String>());
|
|
||||||
}
|
|
||||||
|
|
||||||
modifications.getRemoved().add(entry.getOldPath());
|
modifications.getRemoved().add(entry.getOldPath());
|
||||||
|
|
||||||
@@ -239,14 +226,6 @@ public class GitChangesetViewer implements ChangesetViewer
|
|||||||
|
|
||||||
if (tag != null)
|
if (tag != null)
|
||||||
{
|
{
|
||||||
List<String> tagList = changeset.getTags();
|
|
||||||
|
|
||||||
if (tagList == null)
|
|
||||||
{
|
|
||||||
tagList = new ArrayList<String>();
|
|
||||||
changeset.setTags(tagList);
|
|
||||||
}
|
|
||||||
|
|
||||||
changeset.getTags().add(tag);
|
changeset.getTags().add(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -176,15 +176,15 @@ public class HgChangesetParser
|
|||||||
}
|
}
|
||||||
else if ("files-added".equals(name))
|
else if ("files-added".equals(name))
|
||||||
{
|
{
|
||||||
getModifications(changeset).setAdded(getList(value));
|
changeset.getModifications().setAdded(getList(value));
|
||||||
}
|
}
|
||||||
else if ("files-mods".equals(name))
|
else if ("files-mods".equals(name))
|
||||||
{
|
{
|
||||||
getModifications(changeset).setModified(getList(value));
|
changeset.getModifications().setModified(getList(value));
|
||||||
}
|
}
|
||||||
else if ("files-dels".equals(name))
|
else if ("files-dels".equals(name))
|
||||||
{
|
{
|
||||||
getModifications(changeset).setRemoved(getList(value));
|
changeset.getModifications().setRemoved(getList(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,27 +230,6 @@ public class HgChangesetParser
|
|||||||
return Arrays.asList(value.split(" "));
|
return Arrays.asList(value.split(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param changeset
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private Modifications getModifications(Changeset changeset)
|
|
||||||
{
|
|
||||||
Modifications mods = changeset.getModifications();
|
|
||||||
|
|
||||||
if (mods == null)
|
|
||||||
{
|
|
||||||
mods = new Modifications();
|
|
||||||
changeset.setModifications(mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
return mods;
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
|
|||||||
Reference in New Issue
Block a user