Permalink
Browse files

WIP SVN support.

  • Loading branch information...
1 parent 42b22ff commit 174e9bae7da8444044fd866fb17d246f10b8c90a @acaudwell committed Dec 2, 2010
Showing with 6,086 additions and 23 deletions.
  1. +2 −2 .gitignore
  2. +5 −0 Makefile.am
  3. +15 −10 README
  4. +14 −9 data/gource.1
  5. +15 −0 src/gource.cpp
  6. +1 −0 src/gource.h
  7. +9 −2 src/gource_settings.cpp
  8. +1 −0 src/gource_settings.h
  9. +221 −0 src/svn.cpp
  10. +43 −0 src/svn.h
  11. +116 −0 src/tinyxml/tinystr.cpp
  12. +319 −0 src/tinyxml/tinystr.h
  13. +1,839 −0 src/tinyxml/tinyxml.cpp
  14. +1,799 −0 src/tinyxml/tinyxml.h
  15. +52 −0 src/tinyxml/tinyxmlerror.cpp
  16. +1,635 −0 src/tinyxml/tinyxmlparser.cpp
View
@@ -19,5 +19,5 @@ logs/*
/missing
*.swp
*.d
-/src/.deps/
-/src/.dirstamp
+.deps
+.dirstamp
View
@@ -45,6 +45,11 @@ gource_SOURCES = \
src/pawn.cpp src/pawn.h \
src/slider.cpp src/slider.h \
src/spline.cpp src/spline.h \
+ src/svn.cpp src/svn.h \
+ src/tinyxml/tinyxmlerror.cpp \
+ src/tinyxml/tinystr.cpp src/tinyxml/tinystr.h \
+ src/tinyxml/tinyxml.cpp src/tinyxml/tinyxml.h \
+ src/tinyxml/tinyxmlparser.cpp src/tinyxml/tinyxmlparser.h \
src/user.cpp src/user.h \
src/zoomcamera.cpp src/zoomcamera.h
View
@@ -242,7 +242,7 @@ options:
If path is ommited, gource will attempt to read a log from the
current directory.
-Git, Bazaar and Mercurial Examples:
+Git, Bazaar, Mercurial and SVN Examples:
View the log of the respository in the current path:
@@ -252,24 +252,29 @@ View the log of a project in the specified directory:
gource my-project-dir
-Save a copy of the log using in a special log format and play it back
-(example is for Git):
+For large projects, generating a log of the project history may take a long
+time. For centralized VCS like SVN, generating the log may also put load on
+the central VCS server.
- cd my-git-project
- `gource --git-log-command` > my-git-project.log
- gource my-git-project.log
+In these cases, you may like to save a copy of the log for later use.
-NOTE: --git-log-command assumes you have a recent version git of that supports
- all the options. You may need to modify the command line to work with an
- older version (changing %aN to %an for instance).
+You can generate a log in the VCS specific log format using
+the --log-command VCS option:
+
+ cd my-svn-project
+ `gource --log-command svn` > my-svn-project.log
+ gource my-svn-project.log
+
+You can also have Gource write a copy of the log file in its own format:
+
+ gource --output-custom-log my-project-custom.log
Other Version Control Systems:
Visit the Gource homepage for guides and examples of using Gource with other
version control systems:
CVS - http://code.google.com/p/gource/wiki/CVS
- SVN - http://code.google.com/p/gource/wiki/SVN
Custom Log Format:
View
@@ -208,7 +208,7 @@ Either a supported version control directory, a pre-generated log file (see log
If path is ommited, gource will attempt to read a log from the current directory.
-.SH GIT, BAZAAR AND MERCURIAL EXAMPLES
+.SH GIT, BAZAAR, MERCURIAL AND SVN EXAMPLES
View the log of the respository in the current path:
@@ -220,25 +220,30 @@ View the log of a project in the specified directory:
.ti 10
\fIgource\fR my\-project\-dir
-Save a copy of the log using in a special log format and play it back (example is for Git):
+For large projects, generating a log of the project history may take a long time. For centralized VCS like SVN, generating the log will put load on the central VCS server.
+
+In these cases, you may like to save a copy of the log for later use.
+
+You can generate a log in the VCS specific log format using the \-\-log\-command VCS option:
.ti 10
-cd my\-git\-project
+cd my\-svn\-project
.ti 10
-\`\fIgource\fR \-\-git\-log\-command\` > my\-git\-project.log
+\`\fIgource\fR \-\-log\-command svn\` > my\-svn\-project.log
.ti 10
-\fIgource\fR my\-git\-project.log
+\fIgource\fR my\-svn\-project.log
-NOTE: \-\-git-log-command assumes you have a recent version of git that supports all the options. You may need to modify the command line to work with an older version (changing %aN to %an for instance).
+You can also have Gource write a copy of the log file in its own format:
+
+.ti 10
+\fIgource\fR \-\-output\-custom\-log my\-project\-custom.log
.SH OTHER VERSION CONTROL SYSTEMS
The Gource homepage has guides and examples for using Gource with other version control systems:
.ti 10
-CVS - http://code.google.com/p/gource/wiki/CVS
-.ti 10
-SVN - http://code.google.com/p/gource/wiki/SVN
+CVS \- http://code.google.com/p/gource/wiki/CVS
.SH CUSTOM LOG FORMAT
View
@@ -197,6 +197,12 @@ RCommitLog* Gource::determineFormat(const std::string& logfile) {
delete clog;
}
+ if(gGourceSettings.log_format == "svn") {
+ clog = new SVNCommitLog(logfile);
+ if(clog->checkFormat()) return clog;
+ delete clog;
+ }
+
return 0;
}
@@ -235,6 +241,13 @@ RCommitLog* Gource::determineFormat(const std::string& logfile) {
delete clog;
+ //svn
+ debugLog("tryin svn...\n");
+ clog = new SVNCommitLog(logfile);
+ if(clog->checkFormat()) return clog;
+
+ delete clog;
+
//custom
debugLog("trying custom...\n");
clog = new CustomLog(logfile);
@@ -786,6 +799,8 @@ void Gource::reset() {
manual_zoom = false;
rotation_remaining_angle = 0.0f;
+ message_timer = 0.0f;
+
cursor_move = vec2f(0.0f, 0.0f);
selectedUser = 0;
View
@@ -44,6 +44,7 @@
#include "cvs-exp.h"
#include "custom.h"
#include "apache.h"
+#include "svn.h"
#include "slider.h"
@@ -63,8 +63,8 @@ void GourceSettings::help(bool extended_help) {
printf(" --max-files NUMBER Max number of active files (default: 1000)\n");
printf(" --max-file-lag SECONDS Max time files of a commit can take to appear\n\n");
- printf(" --log-command VCS Show the log command used by gource (git,cvs,hg,bzr)\n");
- printf(" --log-format VCS Specify format of the log (git,cvs,hg,bzr,custom)\n");
+ printf(" --log-command VCS Show the log command used by gource (git,svn,cvs,hg,bzr)\n");
+ printf(" --log-format VCS Specify format of the log (git,cvs,svn,hg,bzr,custom)\n");
printf(" --git-branch Get the git log of a particular branch\n\n");
printf(" --load-config CONF_FILE Load a config file\n");
@@ -172,6 +172,7 @@ GourceSettings::GourceSettings() {
conf_sections["cvs-exp-command"] = "command-line";
conf_sections["hg-log-command"] = "command-line";
conf_sections["bzr-log-command"] = "command-line";
+ conf_sections["svn-log-command"] = "command-line";
conf_sections["load-config"] = "command-line";
conf_sections["save-config"] = "command-line";
conf_sections["output-custom-log"] = "command-line";
@@ -204,6 +205,7 @@ GourceSettings::GourceSettings() {
arg_types["git-log-command"]= "bool";
arg_types["cvs-exp-command"]= "bool";
+ arg_types["svn-log-command"]= "bool";
arg_types["hg-log-command"] = "bool";
arg_types["bzr-log-command"]= "bool";
@@ -382,6 +384,10 @@ void GourceSettings::commandLineOption(const std::string& name, const std::strin
SDLAppInfo(gGourceCvsExpLogCommand);
}
+ if(name == "svn-log-command" || log_command == "svn") {
+ SDLAppInfo(gGourceSVNLogCommand);
+ }
+
if(name == "hg-log-command" || log_command == "hg") {
std::string command = gGourceMercurialCommand();
SDLAppInfo(command);
@@ -550,6 +556,7 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
if( log_format != "git"
&& log_format != "cvs"
+ && log_format != "svn"
&& log_format != "custom"
&& log_format != "hg"
&& log_format != "bzr"
@@ -26,6 +26,7 @@
#include "git.h"
#include "bzr.h"
#include "cvs-exp.h"
+#include "svn.h"
#include "core/settings.h"
#include "core/regex.h"
Oops, something went wrong.

0 comments on commit 174e9ba

Please sign in to comment.