Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

973 changes: 691 additions & 282 deletions .idea/workspace.xml

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Server/src/lk/ijse/vcs/testing/Compare.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lk.ijse.vcs.testing;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
*
* @author Dilini Peiris
*/
public class Compare {

public static void main(String[] args) {
try {

File changes = new File("src/lk/ijse/vcs/testing/changes.txt");
changes.getParentFile().mkdirs();
changes.createNewFile();
// changes=changes.getAbsoluteFile();

/*Used the following to check how File functions
File demo1=new File("Server/src/lk/ijse/vcs/testing/Demo1.java");
System.out.println(demo1.getAbsolutePath());
System.out.println(demo1.exists());*/

BufferedReader earlierFileBufRdr = new BufferedReader(new FileReader(new File("Server/src/lk/ijse/vcs/testing/Demo1.java")));
BufferedReader newFileBufRdr = new BufferedReader(new FileReader(new File("Server/src/lk/ijse/vcs/testing/Demo2.java")));
BufferedWriter resultFileBufWrtr = new BufferedWriter(new FileWriter(changes));

LineNumberReader earlierLine = new LineNumberReader(earlierFileBufRdr);
LineNumberReader newLine = new LineNumberReader(newFileBufRdr);

loop1:
while (true) {
String lineLast = earlierFileBufRdr.readLine(); //line from the last commited file
String lineNew = newFileBufRdr.readLine(); //line from the new file to be commited
int lastLineNum = newLine.getLineNumber();
if (lineLast != null || lineNew != null) {
if (lineLast.equals(lineNew)) {
resultFileBufWrtr.append("" + earlierLine.getLineNumber() + "\t\t" + lineLast);
resultFileBufWrtr.newLine();
continue loop1;
} else {
String lineNewCopy = lineNew;
int newLineNum = newLine.getLineNumber();
boolean isFound = false;
ArrayList<Integer> lineNumbers = new ArrayList<>();
loop2:
while (lineNewCopy != null) {
int newLineNumCopy = newLine.getLineNumber();
if (lineLast.equals(lineNewCopy)) {
System.out.println("newly added lines : " + lineNumbers.toString());
isFound = true;
break loop2;
} else {
lineNumbers.add(newLineNumCopy);
resultFileBufWrtr.append("" + newLineNumCopy + "\t+\t" + lineNewCopy);
resultFileBufWrtr.newLine();
lineNewCopy = newFileBufRdr.readLine();
}
}
if (!isFound) {
resultFileBufWrtr.append("" + lastLineNum + "\t-\t" + lineLast);
resultFileBufWrtr.newLine();
System.out.println("deleted line : " + lastLineNum);
}
newLine.setLineNumber(newLineNum);
}
} else {
break loop1;
}

}
earlierFileBufRdr.close();
newFileBufRdr.close();
resultFileBufWrtr.close();

} catch (IOException ex) {
Logger.getLogger(Compare.class.getName()).log(Level.SEVERE, null, ex);
}

}
}
7 changes: 7 additions & 0 deletions Server/src/lk/ijse/vcs/testing/Demo1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package lk.ijse.vcs.testing;

class Demo1{
public static void main(String args[]){

}
}
7 changes: 7 additions & 0 deletions Server/src/lk/ijse/vcs/testing/Demo2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package lk.ijse.vcs.testing;

class Demo{
public static void main(String args[]){
System.out.print("2");
}
}
Empty file.
Empty file.
Empty file.
223 changes: 223 additions & 0 deletions out/production/Client/lk/ijse/vcs/view/Dashboard.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.input.KeyCodeCombination?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.paint.Color?>
<?import javafx.scene.text.Font?>

<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar VBox.vgrow="NEVER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New Repository">
<accelerator>
<KeyCodeCombination alt="UP" code="N" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Clone Repository">
<accelerator>
<KeyCodeCombination alt="UP" code="O" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator></MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Preferences…">
<accelerator>
<KeyCodeCombination alt="DOWN" code="P" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Quit" />
</items>
<accelerator>
<KeyCodeCombination alt="DOWN" code="F" control="UP" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Undo">
<accelerator>
<KeyCodeCombination alt="UP" code="Z" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Redo">
<accelerator>
<KeyCodeCombination alt="UP" code="Y" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Cut">
<accelerator>
<KeyCodeCombination alt="UP" code="X" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Copy">
<accelerator>
<KeyCodeCombination alt="UP" code="C" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Paste">
<accelerator>
<KeyCodeCombination alt="UP" code="V" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Delete">
<accelerator>
<KeyCodeCombination alt="UP" code="DELETE" control="ANY" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Select All">
<accelerator>
<KeyCodeCombination alt="UP" code="A" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Unselect All" />
</items>
<accelerator>
<KeyCodeCombination alt="DOWN" code="E" control="UP" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</Menu>
<Menu mnemonicParsing="false" text="View">
<items>
<MenuItem mnemonicParsing="false" text="Changes">
<accelerator>
<KeyCodeCombination alt="UP" code="DIGIT1" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="History">
<accelerator>
<KeyCodeCombination alt="UP" code="DIGIT2" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Repository List">
<accelerator>
<KeyCodeCombination alt="UP" code="DIGIT3" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Braches List">
<accelerator>
<KeyCodeCombination alt="UP" code="DIGIT4" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Toggle Full Screen">
<accelerator>
<KeyCodeCombination alt="UP" code="F11" control="UP" meta="UP" shift="UP" shortcut="ANY" />
</accelerator>
</MenuItem>
</items>
<accelerator>
<KeyCodeCombination alt="UP" code="V" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</Menu>
<Menu mnemonicParsing="false" text="Repository">
<items>
<MenuItem mnemonicParsing="false" text="Push">
<accelerator>
<KeyCodeCombination alt="UP" code="P" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Pull">
<accelerator>
<KeyCodeCombination alt="UP" code="P" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Remove" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Show in Explorer">
<accelerator>
<KeyCodeCombination alt="UP" code="F" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Repository Settings" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Branch">
<items>
<MenuItem mnemonicParsing="false" text="New Branch">
<accelerator>
<KeyCodeCombination alt="UP" code="N" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Rename" />
<MenuItem mnemonicParsing="false" text="Delete" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Update from default branch">
<accelerator>
<KeyCodeCombination alt="UP" code="U" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Merge into current branch">
<accelerator>
<KeyCodeCombination alt="UP" code="M" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Create Pull Request">
<accelerator>
<KeyCodeCombination alt="UP" code="R" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
<SeparatorMenuItem mnemonicParsing="false" />
</items>
</Menu>
</menus>
</MenuBar>
<SplitPane dividerPositions="0.2505567928730512, 0.7505567928730512" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<items>
<AnchorPane>
<children>
<Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style="&#10;" text="Master" textAlignment="CENTER" wrapText="false">
<font>
<Font size="18.0" fx:id="x1" />
</font>
<textFill>
<Color blue="0.624" green="0.624" red="0.624" fx:id="x2" />
</textFill>
</Label>
</children>
</AnchorPane>
<ScrollPane prefHeight="-1.0" prefWidth="-1.0">
<content>
<AnchorPane id="Content" minHeight="-1.0" minWidth="-1.0" prefHeight="545.0" prefWidth="430.0">
<children>
<Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="&#10;" text="View" textAlignment="CENTER" textFill="$x2" wrapText="false" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<AnchorPane>
<children>
<Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="&#10;" text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" />
</children>
</AnchorPane>
</items>
</SplitPane>
<HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
<children>
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS">
<font>
<Font size="11.0" fx:id="x3" />
</font>
<textFill>
<Color blue="0.625" green="0.625" red="0.625" fx:id="x4" />
</textFill>
</Label>
<Pane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
<Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" />
</children>
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</padding>
</HBox>
</children>
</VBox>
Loading