diff --git a/harbour/.gitignore b/harbour/.gitignore index 920aa1c5e8..3d13f94a3c 100644 --- a/harbour/.gitignore +++ b/harbour/.gitignore @@ -1,6 +1,3 @@ -# legacy -.svn - # build generated files /include/hbverbld.h *.hbl diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cd2d8229b4..44901ecbb2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-07 23:38 UTC+0200 Viktor Szakats (vszakats syenar.net) + * doc/Makefile + - doc/howtosvn.txt + + doc/howtorep.txt + * NEWS + * website/news1.html + * renamed to neutral name + + * .gitignore + - deleted .svn + + * bin/commit.hb + + added support for git + + * config/global.mk + + added support for git (commented) + + * contrib/hbpost.hbm + * avoid the word SVN + 2012-10-07 22:56 UTC+0200 Viktor Szakats (harbour syenar.net) * src/common/hbverdsp.c ! fix to previous commit diff --git a/harbour/NEWS b/harbour/NEWS index dee06bf387..3a8c038456 100644 --- a/harbour/NEWS +++ b/harbour/NEWS @@ -861,7 +861,7 @@ Version 1.0.0 rc1 (2008-06-04) tag: 1.0.0rc1 General ============================= - The SourceForge repository was moved from CVS to SVN -- added docs/howtosvn.txt +- added docs/howtorep.txt - changed pack_src.sh to extract list of files from local SVN copy using SVN commands - improved CYGWIN compatibility diff --git a/harbour/bin/commit.hb b/harbour/bin/commit.hb index 52eee1e509..a88ee2d398 100644 --- a/harbour/bin/commit.hb +++ b/harbour/bin/commit.hb @@ -35,7 +35,9 @@ PROCEDURE Main() - LOCAL aChanges := DoctorChanges( Changes() ) + LOCAL cVCS := VCSDetect() + + LOCAL aChanges := DoctorChanges( cVCS, Changes( cVCS ) ) LOCAL cLog LOCAL cLogNew LOCAL cLine @@ -88,44 +90,110 @@ PROCEDURE Main() RETURN -STATIC FUNCTION DoctorChanges( aChanges ) +STATIC FUNCTION VCSDetect() + + DO CASE + CASE hb_DirExists( ".svn" ) ; RETURN "svn" + CASE hb_DirExists( ".." + hb_ps() + ".git" ) ; RETURN "git" + ENDCASE + + RETURN "" + +STATIC FUNCTION DoctorChanges( cVCS, aChanges ) LOCAL cLine LOCAL cStart LOCAL aNew := {} ASort( aChanges,,, {| x, y | x < y } ) - FOR EACH cLine IN aChanges - IF ! Empty( cLine ) .AND. SubStr( cLine, 8, 1 ) == " " - cStart := Left( cLine, 1 ) - SWITCH cStart - CASE "M" - CASE " " /* modified props */ - cStart := "*" - EXIT - CASE "A" - cStart := "+" - EXIT - CASE "D" - cStart := "-" - EXIT - CASE "X" - cStart := "" - EXIT - OTHERWISE - cStart := "?" - ENDSWITCH - IF ! Empty( cStart ) - AAdd( aNew, " " + cStart + " " + StrTran( SubStr( cLine, 8 + 1 ), "\", "/" ) ) + DO CASE + CASE cVCS == "svn" + + FOR EACH cLine IN aChanges + IF ! Empty( cLine ) .AND. SubStr( cLine, 8, 1 ) == " " + cStart := Left( cLine, 1 ) + SWITCH cStart + CASE "M" + CASE " " /* modified props */ + cStart := "*" + EXIT + CASE "A" + cStart := "+" + EXIT + CASE "D" + cStart := "-" + EXIT + CASE "X" + cStart := "" + EXIT + OTHERWISE + cStart := "?" + ENDSWITCH + IF ! Empty( cStart ) + AAdd( aNew, " " + cStart + " " + StrTran( SubStr( cLine, 8 + 1 ), "\", "/" ) ) + ENDIF ENDIF - ENDIF - NEXT + NEXT + + CASE cVCS == "git" + + FOR EACH cLine IN aChanges + IF ! Empty( cLine ) .AND. SubStr( cLine, 3, 1 ) == " " + cStart := Left( cLine, 1 ) + SWITCH cStart + CASE " " + CASE "?" + cStart := "" + EXIT + CASE "M" + CASE "R" + CASE "U" + cStart := "*" + EXIT + CASE "A" + CASE "C" + cStart := "+" + EXIT + CASE "D" + cStart := "-" + EXIT + OTHERWISE + cStart := "?" + ENDSWITCH + IF ! Empty( cStart ) + AAdd( aNew, " " + cStart + " " + StrTran( SubStr( cLine, 3 + 1 ), "\", "/" ) ) + ENDIF + ENDIF + NEXT + + ENDCASE RETURN aNew -STATIC FUNCTION Changes() - LOCAL cStdOut - hb_processRun( "svn status -q",, @cStdOut ) +STATIC FUNCTION Shell() + LOCAL cShell + + #if defined( __PLATFORM__UNIX ) + cShell := hb_GetEnv( "SHELL" ) + #else + cShell := hb_GetEnv( "COMSPEC" ) + #endif + + IF ! Empty( cShell ) + #if defined( __PLATFORM__WINDOWS ) .OR. defined( __PLATFORM__DOS ) + cShell := cShell + " /c" + #endif + ENDIF + + RETURN cShell + +STATIC FUNCTION Changes( cVCS ) + LOCAL cStdOut := "" + + DO CASE + CASE cVCS == "svn" ; hb_processRun( Shell() + " " + "svn status -q",, @cStdOut ) + CASE cVCS == "git" ; hb_processRun( Shell() + " " + "git status -s",, @cStdOut ) + ENDCASE RETURN hb_ATokens( StrTran( cStdOut, Chr( 13 ) ), Chr( 10 ) ) diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 3edef661b0..b515ad635c 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1729,6 +1729,10 @@ ifeq ($(HB_INIT_DONE),) endif $(info ! REVISION: $(_tmp)) endif +# ifneq ($(call find_in_path,git),) +# _tmp := $(shell git rev-parse --short HEAD) +# $(info ! REVISION: $(_tmp)) +# endif endif endif diff --git a/harbour/contrib/hbpost.hbm b/harbour/contrib/hbpost.hbm index 877c66e64b..0d1307a84c 100644 --- a/harbour/contrib/hbpost.hbm +++ b/harbour/contrib/hbpost.hbm @@ -2,7 +2,7 @@ # $Id$ # -# These are mandatory in Harbour SVN, they will always +# These are mandatory inside Harbour repository, they will always # override project options. "{HB_BUILD_PARTS='lib'&!hblib}-stop=! Skipped because HB_BUILD_PARTS=lib" diff --git a/harbour/doc/Makefile b/harbour/doc/Makefile index 9d3c589024..2f68bc9223 100644 --- a/harbour/doc/Makefile +++ b/harbour/doc/Makefile @@ -18,7 +18,7 @@ DOC_FILES := \ gtapi.txt \ hdr_tpl.txt \ howtorel.txt \ - howtosvn.txt \ + howtorep.txt \ inet.txt \ locks.txt \ pcode.txt \ diff --git a/harbour/doc/howtosvn.txt b/harbour/doc/howtorep.txt similarity index 99% rename from harbour/doc/howtosvn.txt rename to harbour/doc/howtorep.txt index 5a864eba79..1312185c0c 100644 --- a/harbour/doc/howtosvn.txt +++ b/harbour/doc/howtorep.txt @@ -2,8 +2,8 @@ * $Id$ */ -HOW TO USE THE SVN ------------------- +HOW TO USE THE SOURCE REPOSITORY +-------------------------------- First and if your OS doesn't have it by default, download the client from this link: diff --git a/harbour/website/news1.html b/harbour/website/news1.html index 806cc44c69..dcf9359ea6 100644 --- a/harbour/website/news1.html +++ b/harbour/website/news1.html @@ -237,7 +237,7 @@ ul { General
  • The SourceForge repository was moved from CVS to SVN
  • -
  • added docs/howtosvn.txt
  • +
  • added docs/howtorep.txt
  • changed pack_src.sh to extract list of files from local SVN copy using
    SVN commands
  • improved CYGWIN compatibility