# HG changeset patch # User Mario Torre # Date 1299627573 -3600 # Node ID 24bc15b8e27bf3e6632f5479eddd3aae53174b9a # Parent 82de5424529c53dc15163f16a436d56003f89e1b Add new method create. diff -r 82de5424529c -r 24bc15b8e27b src/org/icedrobot/ika/plugins/scm/GITRepository.java --- a/src/org/icedrobot/ika/plugins/scm/GITRepository.java Tue Mar 08 00:20:49 2011 +0100 +++ b/src/org/icedrobot/ika/plugins/scm/GITRepository.java Wed Mar 09 00:39:33 2011 +0100 @@ -64,6 +64,36 @@ exec(command, getFullPath()); } + + /** + * + */ + @Override + public void create() { + + String command = "git init ."; + System.err.println(command); + exec(command, getFullPath()); + + command = "git add --all"; + System.err.println(command); + exec(command, getFullPath()); + + command = "git commit -m initial_repository --verbose"; + System.err.println(command); + exec(command, getFullPath()); + + command = "git branch " + branch; + System.err.println(command); + exec(command, getFullPath()); + + command = "git checkout " + branch; + System.err.println(command); + exec(command, getFullPath()); + + System.err.println(">>>>>>>> done: " + this + " <<<<<<<<"); + } + /** * */ @@ -78,29 +108,7 @@ new GITRepository(name, new File(getFullPath() + File.separator + getName()), relativePath, null, branch); - - String command = "git init ."; - System.err.println(command); - exec(command, subRepository.getFullPath()); - - command = "git add --all"; - System.err.println(command); - exec(command, subRepository.getFullPath()); - - command = "git commit -m initial_repository --verbose"; - System.err.println(command); - exec(command, subRepository.getFullPath()); - - command = "git branch " + branch; - System.err.println(command); - exec(command, subRepository.getFullPath()); - - command = "git checkout " + branch; - System.err.println(command); - exec(command, subRepository.getFullPath()); - - System.err.println(">>>>>>>> done: " + subRepository + " <<<<<<<<"); - + subRepository.create(); return subRepository; } diff -r 82de5424529c -r 24bc15b8e27b src/org/icedrobot/ika/plugins/scm/HGRepository.java --- a/src/org/icedrobot/ika/plugins/scm/HGRepository.java Tue Mar 08 00:20:49 2011 +0100 +++ b/src/org/icedrobot/ika/plugins/scm/HGRepository.java Wed Mar 09 00:39:33 2011 +0100 @@ -75,4 +75,9 @@ public void applyPatchQueue() { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void create() { + throw new UnsupportedOperationException("Not supported yet."); + } } diff -r 82de5424529c -r 24bc15b8e27b src/org/icedrobot/ika/plugins/scm/Repository.java --- a/src/org/icedrobot/ika/plugins/scm/Repository.java Tue Mar 08 00:20:49 2011 +0100 +++ b/src/org/icedrobot/ika/plugins/scm/Repository.java Wed Mar 09 00:39:33 2011 +0100 @@ -42,6 +42,7 @@ protected String remotePath; protected String branch; + public abstract void create(); public abstract void applyPatchQueue(); public abstract void makeClone(); public abstract Repository makeSubRepository(String name, @@ -71,7 +72,8 @@ } /** - * + * Create the directory under which this repository will be located if it + * doesn't exist. */ public void createRoot() { getFullPath().mkdir();