?? startup.java
字號:
package svnexample;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import org.tmatesoft.svn.core.wc.SVNRevision;
/**
* The class used to startup the sample application and invoke
* relevant methods on the SVNManager.
*/
public class Startup {
public static void main(String[] args) {
LoanData theDomainObject = new LoanData();
theDomainObject.setObjectId("LOAN_002");
theDomainObject.setLoanAmount(500000);
theDomainObject.setLoanRate(5.25f);
theDomainObject.setLoanTerm(30);
theDomainObject.setModificationReason("Created the object");
theDomainObject.setModifiedDate(Calendar.getInstance().getTime());
theDomainObject.setModifiedUser("Swami");
System.out.println("--------------------------------------------------------");
System.out.println("Starting the demo by creating the demo object LoanObject");
System.out.println("The domain object looks like : " +
theDomainObject.getXmlRepresentation());
System.out.println("--------------------------------------------------------");
SVNManager theManager = new SVNManager();
System.out.println("Initialized the SVN Manager");
SVNResult theResult = theManager.checkInObject(theDomainObject);
System.out.println("Checked in the object into SVN with " +
"a return flag of " + theResult.isSuccessful());
System.out.println("The message obtained after checking in object is" +
" " + theResult.getSvnMessage());
System.out.println("--------------------------------------------------------");
theDomainObject.setLoanAmount(200000);
theDomainObject.setModificationReason("Reduced loan amount due to surplus tax returns");
System.out.println("Changed the loan amount and set the approriate reason for change");
theResult = theManager.checkInObject(theDomainObject);
System.out.println("Checked in the object into SVN with " +
"a return flag of " + theResult.isSuccessful());
System.out.println("The message obtained after checking in object is" +
" " + theResult.getSvnMessage());
System.out.println("--------------------------------------------------------");
System.out.println("Showing the list of history for our loan object in the repository");
displayRevisionInfo(theManager.getRevisionLog(theDomainObject,0,-1));
System.out.println("--------------------------------------------------------");
//Uncomment the following code to see the difference between two versions providing
//the correct version numbers in the repository
//System.out.println(theManager.showDifferences(theDomainObject, xx, xx));
}
public static void displayRevisionInfo(List revisions) {
for(Iterator iter=revisions.iterator();iter.hasNext();) {
SVNRevisionInfo revisionInfo = (SVNRevisionInfo) iter.next();
System.out.println("Revision Number : " + revisionInfo.getRevisionNumber());
System.out.println("Revision Notes : " + revisionInfo.getModificationReason());
System.out.println("Revision User : " + revisionInfo.getModifiedUser());
System.out.println("Revision Date : " + revisionInfo.getRevisionDate());
System.out.println("Revision Contents : " + revisionInfo.getRevisionContents());
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -