[GME-commit] GMESRC/GME/XmlBackEnd CoreXmlFile.cpp, 1.26, 1.27 CoreXmlFile.h, 1.10, 1.11 OperOptions.cpp, 1.2, 1.3 SvnConfig.h, 1.3, 1.4 SvnLoginDlg.cpp, 1.1, 1.2 SvnLoginDlg.h, 1.1, 1.2 SvnTester.cpp, 1.3, 1.4 XmlBackEnd.rc, 1.7, 1.8 XmlBackEnd.vcproj, 1.6, 1.7 resource.h, 1.5, 1.6

Log messages of CVS commits gme-commit at list.isis.vanderbilt.edu
Fri Feb 15 15:06:45 CST 2008


Update of /project/gme-repository/GMESRC/GME/XmlBackEnd
In directory escher:/tmp/cvs-serv29705

Modified Files:
	CoreXmlFile.cpp CoreXmlFile.h OperOptions.cpp SvnConfig.h 
	SvnLoginDlg.cpp SvnLoginDlg.h SvnTester.cpp XmlBackEnd.rc 
	XmlBackEnd.vcproj resource.h 
Log Message:
-loading credentials from the cache (e.g. from files like C:\DocumentsAndSettings\Username\Subversion\Auth\svn.simple\o495239847529384)
with matching hostnames.

-applyLockSVN now throws if could not apply the lock onto the file


-rollback performed if checkout fails (SVN, CC, SS) during operation




CVS User: Zoltan Molnar, ISIS (zolmol)

Index: XmlBackEnd.vcproj
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/XmlBackEnd.vcproj,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** XmlBackEnd.vcproj	13 Feb 2008 18:54:57 -0000	1.6
--- XmlBackEnd.vcproj	15 Feb 2008 21:06:43 -0000	1.7
***************
*** 42,46 ****
  				Name="VCCustomBuildTool"
  				Description="Performing registration"
! 				CommandLine="regsvr32 /s /c "$(TargetPath)"
  echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
  "
--- 42,51 ----
  				Name="VCCustomBuildTool"
  				Description="Performing registration"
! 				CommandLine="copy ..\lib\libeay32.dll  "$(OutDir)"
! copy ..\lib\ssleay32.dll  "$(OutDir)"
! copy ..\lib\subv_$(ConfigurationName)\libapr.dll $(OutDir)
! copy ..\lib\subv_$(ConfigurationName)\libaprutil.dll $(OutDir)
! copy ..\lib\subv_$(ConfigurationName)\libapriconv.dll $(OutDir)
! regsvr32 /s /c "$(TargetPath)"
  echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
  "
***************
*** 52,56 ****
  				LinkIncremental="2"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="../lib"
  				ModuleDefinitionFile=".\XmlBackEnd.def"
  				GenerateDebugInformation="TRUE"
--- 57,61 ----
  				LinkIncremental="2"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="..\lib\subv_$(ConfigurationName);../lib"
  				ModuleDefinitionFile=".\XmlBackEnd.def"
  				GenerateDebugInformation="TRUE"
***************
*** 116,120 ****
  				Name="VCCustomBuildTool"
  				Description="Performing registration"
! 				CommandLine="regsvr32 /s /c "$(TargetPath)"
  echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
  "
--- 121,130 ----
  				Name="VCCustomBuildTool"
  				Description="Performing registration"
! 				CommandLine="copy ..\lib\libeay32.dll  "$(OutDir)"
! copy ..\lib\ssleay32.dll  "$(OutDir)"
! copy ..\lib\subv_$(ConfigurationName)\libapr.dll $(OutDir)
! copy ..\lib\subv_$(ConfigurationName)\libaprutil.dll $(OutDir)
! copy ..\lib\subv_$(ConfigurationName)\libapriconv.dll $(OutDir)
! regsvr32 /s /c "$(TargetPath)"
  echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
  "
***************
*** 122,130 ****
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="xerces-c_2.lib comsvcs.lib setargv.obj"
  				OutputFile=".\Release/XmlBackEnd.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="../lib"
  				ModuleDefinitionFile=".\XmlBackEnd.def"
  				GenerateDebugInformation="TRUE"
--- 132,143 ----
  			<Tool
  				Name="VCLinkerTool"
+ 				AdditionalOptions="
+ "
  				AdditionalDependencies="xerces-c_2.lib comsvcs.lib setargv.obj"
  				OutputFile=".\Release/XmlBackEnd.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="..\lib\subv_$(ConfigurationName);../lib"
! 				IgnoreDefaultLibraryNames=""
  				ModuleDefinitionFile=".\XmlBackEnd.def"
  				GenerateDebugInformation="TRUE"

Index: XmlBackEnd.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/XmlBackEnd.rc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** XmlBackEnd.rc	13 Feb 2008 18:54:57 -0000	1.7
--- XmlBackEnd.rc	15 Feb 2008 21:06:43 -0000	1.8
***************
*** 226,229 ****
--- 226,230 ----
      LTEXT           "User:",IDC_STATIC,152,55,17,8
      EDITTEXT        IDC_EDIT_USER,193,52,86,14,ES_AUTOHSCROLL
+     PUSHBUTTON      "Load",IDC_LOADFROMCACHE,282,52,22,14
      LTEXT           "Password:",IDC_STATIC,152,73,33,8
      EDITTEXT        IDC_EDIT_PWD,193,72,86,14,ES_PASSWORD | ES_AUTOHSCROLL

Index: SvnLoginDlg.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/SvnLoginDlg.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SvnLoginDlg.h	13 Feb 2008 18:54:57 -0000	1.1
--- SvnLoginDlg.h	15 Feb 2008 21:06:43 -0000	1.2
***************
*** 10,14 ****
  
  public:
! 	CSvnLoginDlg(CWnd* pParent = NULL);   // standard constructor
  	virtual ~CSvnLoginDlg();
  
--- 10,14 ----
  
  public:
! 	CSvnLoginDlg( int prefChoice, CWnd* pParent = NULL);   // standard constructor
  	virtual ~CSvnLoginDlg();
  
***************
*** 19,26 ****
  	bool wasAborted();
  	void setSshOptionInitially();
  
  protected:
  	bool m_aborted;
! 	bool m_sshInitially;
  	int  m_leftPad;
  	int  m_rightPad;
--- 19,32 ----
  	bool wasAborted();
  	void setSshOptionInitially();
+ 	void disableSshOption();
+ 
+ protected:
+ 	bool getDataFromCache( const std::string& p_inRealm, std::string& p_realm, std::string& p_uname);
+ 	bool loadCacheFile   ( const char* p_fileNamePtr, std::string& p_realm, std::string& p_uname);
  
  protected:
+ 	const int m_prefChoice;
  	bool m_aborted;
! 	bool m_sshDisabled;
  	int  m_leftPad;
  	int  m_rightPad;
***************
*** 37,40 ****
--- 43,47 ----
  	afx_msg void OnBnClickedRadioCached();
  	afx_msg void OnBnClickedRadioPpk();
+ 	afx_msg void OnBnClickedLoadFromCache();
  
  	CString	m_password;
***************
*** 43,47 ****
  	CString	m_project;
  
! 	CButton m_loginMethod;
  	CEdit m_passwordCtrl;
  	int m_credRadioBtn;
--- 50,56 ----
  	CString	m_project;
  
! 	CButton m_radBtnLoginMethod;
! 	CButton m_btnLoadFromCache;
! 	CEdit m_userCtrl;
  	CEdit m_passwordCtrl;
  	int m_credRadioBtn;

Index: OperOptions.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/OperOptions.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OperOptions.cpp	13 Feb 2008 18:54:57 -0000	1.2
--- OperOptions.cpp	15 Feb 2008 21:06:43 -0000	1.3
***************
*** 234,240 ****
  	//parent->sendMsg( std::string( "OnDeleteAlwaysFullLock=")+ (m_onDeleteAlwaysFullLock?"true":"false"), MSG_INFO);
  	parent->sendMsg( std::string( "OnLoadShowStatus=")      + (m_onLoadShowStatus?"true":"false"), MSG_INFO);
! 	parent->sendMsg( std::string( "MeasureTime=")           + (m_measureTime?"true":"false"), MSG_INFO);
  #ifdef _DEBUG
! 	parent->sendMsg( std::string( "Log=")                   + (m_createLog?"true":"false"), MSG_INFO);
  #endif
  	parent->sendMsg( std::string( "PartialLoad=")           + (m_partialLoad?"true":"false"), MSG_INFO);
--- 234,240 ----
  	//parent->sendMsg( std::string( "OnDeleteAlwaysFullLock=")+ (m_onDeleteAlwaysFullLock?"true":"false"), MSG_INFO);
  	parent->sendMsg( std::string( "OnLoadShowStatus=")      + (m_onLoadShowStatus?"true":"false"), MSG_INFO);
! 	//parent->sendMsg( std::string( "[Debug]MeasureTime=")           + (m_measureTime?"true":"false"), MSG_INFO);
  #ifdef _DEBUG
! 	//parent->sendMsg( std::string( "[DebugMode]Log=")                   + (m_createLog?"true":"false"), MSG_INFO);
  #endif
  	parent->sendMsg( std::string( "PartialLoad=")           + (m_partialLoad?"true":"false"), MSG_INFO);

Index: CoreXmlFile.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CoreXmlFile.h	13 Feb 2008 18:54:57 -0000	1.10
--- CoreXmlFile.h	15 Feb 2008 21:06:43 -0000	1.11
***************
*** 664,667 ****
--- 664,668 ----
  
  	void         checkOutContainer      (XmlObject * obj);
+ 	void         rollBackTheCheckOutContainer( XmlObject * obj);
  
  	void         addToSS                ( const std::string& p_path);
***************
*** 719,728 ****
  	void         getSVCurrentOwner      ( XmlObject * obj, std::string& user, bool& newfile);
  	bool         isCheckedOutByElseSVN  ( const std::string& p_file);
! 	void         checkOutSVN            ( const std::string& p_file);
  	bool         isVersionedInSVN       ( const std::string& p_file, bool p_isADir = false, bool p_suppressErrorMsg = false);
  	bool         infoSVN                ( const std::string& p_url, bool p_recursive, std::string& p_resultMsg, std::string& p_author, std::string& p_owner);
  
  	bool         lockablePropertySVN    ( const std::string& p_file);
! 	bool         applyLockSVN           ( const std::string& p_file);
  	bool         removeLockSVN          ( const std::string& p_file);
  	bool         mkdirSVN               ( const std::string& p_url, const std::string& p_newDirName, const std::string& p_localPath);
--- 720,729 ----
  	void         getSVCurrentOwner      ( XmlObject * obj, std::string& user, bool& newfile);
  	bool         isCheckedOutByElseSVN  ( const std::string& p_file);
! 	//void         checkOutSVN            ( const std::string& p_file);
  	bool         isVersionedInSVN       ( const std::string& p_file, bool p_isADir = false, bool p_suppressErrorMsg = false);
  	bool         infoSVN                ( const std::string& p_url, bool p_recursive, std::string& p_resultMsg, std::string& p_author, std::string& p_owner);
  
  	bool         lockablePropertySVN    ( const std::string& p_file);
! 	bool         applyLockSVN           ( const std::string& p_file); // throws if failed to lock
  	bool         removeLockSVN          ( const std::string& p_file);
  	bool         mkdirSVN               ( const std::string& p_url, const std::string& p_newDirName, const std::string& p_localPath);

Index: CoreXmlFile.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** CoreXmlFile.cpp	13 Feb 2008 18:54:57 -0000	1.26
--- CoreXmlFile.cpp	15 Feb 2008 21:06:43 -0000	1.27
***************
*** 22,25 ****
--- 22,28 ----
  using std::string;
  
+ #define DETAILS_ABOUT_XMLBACKEND 0
+ #define RESOLVE_PTRS_2ND_ATTEMPT 0
+ 
  std::string g_userName;
  std::string g_passWord;
***************
*** 964,971 ****
--- 967,978 ----
  	}
  
+ #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  	time_t time1, time2;
  	struct tm *tm1, *tm2;
  	time( &time1); tm1 = localtime( &time1);
  	//sendMsg( std::string( "CommitBegin ") + asctime( tm1 ), MSG_INFO);
+ #endif
+ #endif
  
  	// ignore UpdateSourceControlInfo regnode
***************
*** 977,980 ****
--- 984,988 ----
  	//  COMRETURN(E_INVALID_USAGE);
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  	std::string iiid, mylo;
  	std::string gd; guid2str( m_openedObject->m_guid, gd);
***************
*** 993,996 ****
--- 1001,1005 ----
  	if( m_userOpts.m_createLog) mylo += iiid;
  #endif
+ #endif
  
  	COMTRY
***************
*** 1041,1048 ****
--- 1050,1059 ----
  
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  					if( m_userOpts.m_createLog) {std::string nn,mm; parent->m_attributes.find( ATTRID_NAME )->second->toString( nn);
  					m_openedObject->m_attributes.find(ATTRID_NAME)->second->toString(mm);
  					mylo += (is_removal?" <br>-deleting ":" <br>-moving ") + mm + " in " + nn + "- <br>" ;}
  #endif
+ #endif
  
  				}
***************
*** 1136,1140 ****
  
  					// commented on Sept.3.
! 					//XmlObjSet checkOutContainers;
  					//XmlObjSet fdfdf;
  					// 
--- 1147,1151 ----
  
  					// commented on Sept.3.
! 					//XmlObjSet to_be_checked_out_containers;
  					//XmlObjSet fdfdf;
  					// 
***************
*** 1150,1155 ****
  						++l;
  					}
! 					//getMyDepObjConts( fdfdf, checkOutContainers, true);
! 					//m_modifiedObjects.insert( checkOutContainers.begin(), checkOutContainers.end());
  				}
  
--- 1161,1166 ----
  						++l;
  					}
! 					//getMyDepObjConts( fdfdf, to_be_checked_out_containers, true);
! 					//m_modifiedObjects.insert( to_be_checked_out_containers.begin(), to_be_checked_out_containers.end());
  				}
  
***************
*** 1192,1195 ****
--- 1203,1207 ----
  
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  					if( m_userOpts.m_createLog) {
  						if( relid > RELID_BASE_MAX)
***************
*** 1199,1202 ****
--- 1211,1215 ----
  					}
  #endif
+ #endif
  					if( !secondary_deriv)
  					{
***************
*** 1208,1212 ****
  						XmlObjSet checkOutBases;
  						XmlObjSet fdfdf;
! 						XmlObjSet checkOutContainers;
  						// find all dependents of parent (? and m_openedObject)
  						// where the deleted port can be seen
--- 1221,1225 ----
  						XmlObjSet checkOutBases;
  						XmlObjSet fdfdf;
! 						XmlObjSet to_be_checked_out_containers;
  						// find all dependents of parent (? and m_openedObject)
  						// where the deleted port can be seen
***************
*** 1218,1224 ****
  
  						getBasesOf( fdfdf, checkOutBases);
! 						getAllUpAndDown( fdfdf, checkOutContainers);checkOutContainers.insert( checkOutBases.begin(), checkOutBases.end());
  						// perform a dummy operation on all containers
! 						for( XmlObjSet::const_iterator it = checkOutContainers.begin(); it != checkOutContainers.end(); ++it)
  						{
  							XmlObject * p = *it;
--- 1231,1237 ----
  
  						getBasesOf( fdfdf, checkOutBases);
! 						getAllUpAndDown( fdfdf, to_be_checked_out_containers);to_be_checked_out_containers.insert( checkOutBases.begin(), checkOutBases.end());
  						// perform a dummy operation on all containers
! 						for( XmlObjSet::const_iterator it = to_be_checked_out_containers.begin(); it != to_be_checked_out_containers.end(); ++it)
  						{
  							XmlObject * p = *it;
***************
*** 1233,1237 ****
  							}
  						}
! 						m_modifiedObjects.insert( checkOutContainers.begin(), checkOutContainers.end());
  					}
  				}
--- 1246,1250 ----
  							}
  						}
! 						m_modifiedObjects.insert( to_be_checked_out_containers.begin(), to_be_checked_out_containers.end());
  					}
  				}
***************
*** 1272,1275 ****
--- 1285,1289 ----
  					m_modifiedObjects.insert( end_obj);
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  					if( m_userOpts.m_createLog) {
  						std::string nn,mm; end_obj->m_attributes.find( ATTRID_NAME )->second->toString( nn);
***************
*** 1278,1281 ****
--- 1292,1296 ----
  					}
  #endif
+ #endif
  
  				}
***************
*** 1295,1298 ****
--- 1310,1314 ----
  					m_modifiedObjects.insert( segment_ref);
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  					if( m_userOpts.m_createLog) {
  						std::string nn,mm; segment_ref->m_attributes.find( ATTRID_NAME )->second->toString( nn);
***************
*** 1301,1304 ****
--- 1317,1321 ----
  					}
  #endif
+ #endif
  
  				}
***************
*** 1344,1351 ****
--- 1361,1370 ----
  		{
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  			if( m_userOpts.m_createLog) {
  				mylo += " - valtype_StLoRe " ;
  			}
  #endif
+ #endif
  			m_modifiedObjects.insert( m_openedObject );
  
***************
*** 1366,1369 ****
--- 1385,1389 ----
  
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  		if( m_userOpts.m_createLog) {
  			mylo += "\r\n";
***************
*** 1371,1375 ****
  				mylog += mylo;
  		}
! #endif
  		std::string gd_str; guid2str( m_openedObject->m_guid, gd_str);
  		char* kind[] = {"100", "M", "A", "R", "C", "S", "F", "connrole", "connseg"
--- 1391,1396 ----
  				mylog += mylo;
  		}
! //#endif
! //#endif
  		std::string gd_str; guid2str( m_openedObject->m_guid, gd_str);
  		char* kind[] = {"100", "M", "A", "R", "C", "S", "F", "connrole", "connseg"
***************
*** 1392,1395 ****
--- 1413,1418 ----
  		if( m_userOpts.m_measureTime)
  			sendMsg( buff, MSG_INFO);
+ #endif
+ #endif
  
  		m_openedObject->m_modified = true;
***************
*** 1514,1519 ****
  	m_hashInfoFound         = false;
  	m_hashVal               = -1;
! 	m_comSvn                = CComPtr<ISvnExec>( 0);
! 	m_cmdSvn                = 0;
  }
  
--- 1537,1547 ----
  	m_hashInfoFound         = false;
  	m_hashVal               = -1;
! 	m_comSvn = CComPtr<ISvnExec>( 0);
! 	if( m_cmdSvn)
! 	{
! 		delete m_cmdSvn;
! 		m_cmdSvn = 0;
! 	}
! 
  }
  
***************
*** 1536,1541 ****
  	readProjectFile();
  
  	// if usecache option is false or if cache not read succesfully
! 	if( !m_userOpts.m_partialLoad)
  		//if( !m_userOpts.m_partialLoad || !readBinaryCache())
  		//if( true )
--- 1564,1574 ----
  	readProjectFile();
  
+ 	bool cache_loading_succeeded = false;
+ 	if( m_userOpts.m_partialLoad)
+ 		cache_loading_succeeded = readBinaryCache();
  	// if usecache option is false or if cache not read succesfully
! 
! 	//if( !m_userOpts.m_partialLoad)
! 	if( !m_userOpts.m_partialLoad || !cache_loading_succeeded) // part_load was not requested or it was, but failed
  		//if( !m_userOpts.m_partialLoad || !readBinaryCache())
  		//if( true )
***************
*** 1552,1556 ****
  		if( m_sourceControl != SC_NONE )
  			getLatestVersion();        
! 
  		readAll( false );
  		//// graph has been read  successfully, get latest and update graph
--- 1585,1589 ----
  		if( m_sourceControl != SC_NONE )
  			getLatestVersion();        
! #pragma message( "idfdfgdfgdklf")
  		readAll( false );
  		//// graph has been read  successfully, get latest and update graph
***************
*** 1636,1640 ****
  	m_userOpts.display( this);
  
! 	//if( m_userOpts.m_partialLoad) writeBinaryCache();
  	writeAll();
  
--- 1669,1673 ----
  	m_userOpts.display( this);
  
! 	if( m_userOpts.m_partialLoad) writeBinaryCache();
  	writeAll();
  
***************
*** 1674,1677 ****
--- 1707,1711 ----
  		m_signer.off();
  		clearAll();
+ 		resetSettings();
  		XMLPlatformUtils::Terminate();
  	}
***************
*** 1709,1724 ****
  	bool failed = false;
  
  	time_t time1, time2, time3;
  	struct tm *tm1, *tm2, *tm3;
  	time( &time1); tm1 = localtime( &time1);
  	//if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitBegin ") + asctime( tm1 ), MSG_INFO);
  
  
! 	XmlObjSet checkOutContainers;
! 	getCheckOutContainers(m_modifiedObjects, checkOutContainers);
! 
  	time( &time2); tm2 = localtime( &time2);
  	//if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitMidle ") + asctime( tm2 ), MSG_INFO);
! 
  
  	CloseObject();
--- 1743,1764 ----
  	bool failed = false;
  
+ #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  	time_t time1, time2, time3;
  	struct tm *tm1, *tm2, *tm3;
  	time( &time1); tm1 = localtime( &time1);
  	//if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitBegin ") + asctime( tm1 ), MSG_INFO);
+ #endif
+ #endif
  
+ 	XmlObjSet to_be_checked_out_containers;
+ 	getCheckOutContainers(m_modifiedObjects, to_be_checked_out_containers);
  
! #ifdef _DEBUG
! #if(DETAILS_ABOUT_XMLBACKEND)
  	time( &time2); tm2 = localtime( &time2);
  	//if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitMidle ") + asctime( tm2 ), MSG_INFO);
! #endif
! #endif
  
  	CloseObject();
***************
*** 1726,1731 ****
  	//m_needClose = false;
  
! 	if( !checkOutFiles(checkOutContainers) )
  	{
  		time( &time3);
  		tm3 = localtime( &time3);
--- 1766,1773 ----
  	//m_needClose = false;
  
! 	if( !checkOutFiles(to_be_checked_out_containers) )
  	{
+ #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  		time( &time3);
  		tm3 = localtime( &time3);
***************
*** 1736,1739 ****
--- 1778,1783 ----
  
  		if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitAbort ") + asctime( tm3) + buff, MSG_INFO);
+ #endif
+ #endif
  		return E_FAIL;
  	}
***************
*** 1749,1752 ****
--- 1793,1798 ----
  
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
+ 
  		if( m_userOpts.m_createLog) {
  			//while( -1 != mylog.find( "\r\n"))
***************
*** 1760,1765 ****
--- 1806,1815 ----
  		}
  #endif
+ #endif
  		//if( m_needClose )
  		//  m_gme->CloseProject( TRUE );
+ 
+ #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  		time( &time3);
  		tm3 = localtime( &time3);
***************
*** 1770,1773 ****
--- 1820,1825 ----
  
  		if( m_userOpts.m_measureTime) sendMsg( std::string( "CommitSucce ") + asctime( tm3) + buff, MSG_INFO);
+ #endif
+ #endif
  		m_protectList.onCommited();
  
***************
*** 2252,2265 ****
  	m_openedObject = NULL;
  	m_root = NULL;
- 	m_comSvn = CComPtr<ISvnExec>( 0);
- 	if( m_cmdSvn)
- 	{
- 		delete m_cmdSvn;
- 		m_cmdSvn = 0;
- 	}
- 	//m_hashFileNames = false;
- 	//m_svnByAPI = false; // should not we reset these too
- 	//m_svnRedirectOutput = false;
- 	//m_svnShowCmdLineWindows = false;
  }
  
--- 2304,2307 ----
***************
*** 2373,2378 ****
--- 2415,2422 ----
  {
  #ifdef DEBUG
+ #if(RESOLVE_PTRS_2ND_ATTEMPT)
  	UnresolvedPointerVec again_unresolved;
  #endif
+ #endif
  
  	for( UnresolvedPointerVecIt it=pointers.begin(); it!=pointers.end(); ++it )
***************
*** 2393,2398 ****
--- 2437,2444 ----
  				// TODO: invalid pointer, what to do?
  #ifdef DEBUG
+ #if(RESOLVE_PTRS_2ND_ATTEMPT)
  				again_unresolved.push_back( *it);
  #endif
+ #endif
  			}
  		}
***************
*** 2401,2404 ****
--- 2447,2451 ----
  	// analyze unresolved pointers in debug mode:
  #ifdef DEBUG
+ #if(RESOLVE_PTRS_2ND_ATTEMPT)
  	int still_unresolved = again_unresolved.size();
  	ASSERT( still_unresolved == 0);                        // notify user!!!
***************
*** 2480,2484 ****
  	}
  #endif
! 
  }
  
--- 2527,2531 ----
  	}
  #endif
! #endif
  }
  
***************
*** 2836,2843 ****
--- 2883,2892 ----
  
  #ifdef _DEBUG
+ #if(DETAILS_ABOUT_XMLBACKEND)
  	char buff[329];
  	sprintf( buff, " ..--== size[ModifiedObjects] = %i, size[checkOutContainers] = %i ==--..", m_modifiedObjects.size(), containers.size());
  	sendMsg( buff, MSG_INFO);
  #endif
+ #endif
  
  	XmlObjSetIter it;
***************
*** 2941,2947 ****
  		catch(...)
  		{
! 			// TODO: couldn't checkout all things, what's next?
  			// undocheckout or checkoutrollback needed for those which succesfully were checkedout
  			// roll back transaction, and notify user about what happened
  			return false;
  		}
--- 2990,3003 ----
  		catch(...)
  		{
! 			// couldn't checkout all things, what's next?
  			// undocheckout or checkoutrollback needed for those which succesfully were checkedout
  			// roll back transaction, and notify user about what happened
+ 			sendMsg( "Could not check out all files needed to complete operation.", MSG_ERROR);
+ 			sendMsg( "Rollback follows.", MSG_INFO);
+ 
+ 			for( it=readOnlyFiles.begin(); it!=readOnlyFiles.end(); ++it )
+ 				rollBackTheCheckOutContainer( *it ); // it has a try catch block inside, thus it is safe
+ 
+ 			sendMsg( "Rollback finished. See details above.", MSG_INFO);
  			return false;
  		}
***************
*** 3911,3952 ****
  	}
  
! 	//sprintf( buf, "%s\\*", m_folderPath.c_str() );
! 	//long sh = _findfirst( buf, &fileInfo );
! 	//long rt = sh;
! 	//while( rt != -1 )
! 	//{
! 	//	if( (fileInfo.attrib & _A_SUBDIR) == _A_SUBDIR)
! 	//	{
! 	//		std::string f( fileInfo.name);
! 	//		if( f != ".." && f != ".")
! 	//		{
! 	//			int k = 0;
! 	//			++k;
! 	//		}
! 	//	}
! 	//	rt = _findnext( sh, &fileInfo );
! 	//}
! 	//_findclose( sh );
! 
! 	//sprintf( buf, "%s\\*", m_folderPath.c_str() );
! 	//loadFrom( m_folderPath, pointers, fullLoad);
! 
! 	//clearAll();
  	// load all dirs
  	loadDirs( m_folderPath, pointers, fullLoad);
  
- 	//sprintf( buf, "%s\\*.xml", m_folderPath.c_str() );
- 
- 	//long searchHandle = _findfirst( buf, &fileInfo );
- 	//long ret = searchHandle;
- 	//while( ret != -1 )
- 	//{
- 	//	sprintf( buf, "%s\\%s", m_folderPath.c_str(), fileInfo.name );
- 	//	//sendMsg( buf, MSG_INFO);
- 	//	readXMLFile( buf, pointers, fullLoad );
- 	//	ret = _findnext( searchHandle, &fileInfo );
- 	//}
- 	//_findclose( searchHandle );
- 
  	if( m_userOpts.m_measureTime) { sendMsg( "resolvePointers", MSG_INFO); }
  
--- 3967,3974 ----
  	}
  
! 	clearAll();
  	// load all dirs
  	loadDirs( m_folderPath, pointers, fullLoad);
  
  	if( m_userOpts.m_measureTime) { sendMsg( "resolvePointers", MSG_INFO); }
  
***************
*** 4046,4056 ****
  	{
  		bool is_ssh_hinted = isUrlSvnSsh();
! 		CSvnLoginDlg dlg;
  		dlg.m_project  = m_projectFileName.c_str();
  		dlg.m_database = m_svnUrl.c_str();
  		dlg.m_user     = m_userOpts.m_useAccountInfo? m_userOpts.m_defUserName.c_str(): userNameFromSvnSshUrl().c_str();
  		dlg.m_password = m_userOpts.m_useAccountInfo? m_userOpts.m_defPassword.c_str(): "";
! 		if( is_ssh_hinted)
! 			dlg.setSshOptionInitially();
  
  		if( m_userOpts.m_useAccountInfo && m_userOpts.m_automaticLogin || dlg.DoModal() == IDOK )
--- 4068,4078 ----
  	{
  		bool is_ssh_hinted = isUrlSvnSsh();
! 		CSvnLoginDlg dlg( is_ssh_hinted? 2 : 0);
  		dlg.m_project  = m_projectFileName.c_str();
  		dlg.m_database = m_svnUrl.c_str();
  		dlg.m_user     = m_userOpts.m_useAccountInfo? m_userOpts.m_defUserName.c_str(): userNameFromSvnSshUrl().c_str();
  		dlg.m_password = m_userOpts.m_useAccountInfo? m_userOpts.m_defPassword.c_str(): "";
! 		if( !is_ssh_hinted) // https etc.
! 			dlg.disableSshOption();
  
  		if( m_userOpts.m_useAccountInfo && m_userOpts.m_automaticLogin || dlg.DoModal() == IDOK )
***************
*** 4461,4465 ****
  		std::string file_name;
  		getContainerFileName( obj, file_name, true);
! 		checkOutSVN( file_name);
  	}
  }
--- 4483,4523 ----
  		std::string file_name;
  		getContainerFileName( obj, file_name, true);
! 		applyLockSVN( file_name);
! 	}
! }
! 
! void CCoreXmlFile::rollBackTheCheckOutContainer(XmlObject * obj)
! {
! 	ASSERT( m_sourceControl != SC_NONE );
! 
! 	std::string fileName;
! 	getContainerFileName( obj, fileName);
! 
! 	try
! 	{
! 		if( isSS())
! 		{
! 			std::string fullPath;
! 			getSourceSafePath( obj, fullPath );
! 			CComBSTR fullPath2 = fullPath.c_str();
! 
! 			CComObjPtr<IVSSItem> item;
! 			COMTHROW( m_vssDatabase->get_VSSItem( fullPath2, false, &(item.p)) );
! 			CComBSTR loca = fileName.c_str();
! 			COMTHROW( item->UndoCheckout( loca, 0));
! 		}
! 		else if( isCC())
! 		{
! 			checkInFileCC( fileName.c_str() );
! 		}
! 		else if( isSV())
! 		{
! 			bool sc = removeLockSVN( fileName);
! 			if( !sc) HR_THROW( E_FAIL);
! 		}
! 	}
! 	catch(...)
! 	{
! 		sendMsg( "Could not rollback the lock for " + fileName, MSG_WARNING);
  	}
  }
***************
*** 4629,4633 ****
  	if( FileHelp::isFileReadOnly( obj))
  	{
! 		m_parent->checkOutSVN( obj);
  		//ASSERT( !m_parent->isFileReadOnly( obj));
  	}
--- 4687,4691 ----
  	if( FileHelp::isFileReadOnly( obj))
  	{
! 		m_parent->applyLockSVN( obj);
  		//ASSERT( !m_parent->isFileReadOnly( obj));
  	}
***************
*** 4645,4649 ****
  	if( !FileHelp::isFileReadOnly( obj)) // probably the file did not change, so that's why the commit did not remove the lock
  	{
! 		m_parent->removeLockSVN( obj);
  		ASSERT( FileHelp::isFileReadOnly( obj));
  	}
--- 4703,4708 ----
  	if( !FileHelp::isFileReadOnly( obj)) // probably the file did not change, so that's why the commit did not remove the lock
  	{
! 		bool sc = m_parent->removeLockSVN( obj);
! 		ASSERT( sc);
  		ASSERT( FileHelp::isFileReadOnly( obj));
  	}
***************
*** 4730,4733 ****
--- 4789,4793 ----
  	try
  	{
+ back_again:
  		bool held = true;
  		while( held)
***************
*** 4745,4749 ****
  		if( !held)
  		{
! 			acquireFile();
  			if( isSV()) {
  				std::string owner;
--- 4805,4815 ----
  		if( !held)
  		{
! 			try {
! 				acquireFile();
! 			}
! 			catch(hresult_exception&) {
! 				// somebody else acquired it in the meantime
! 				goto back_again;
! 			}
  			if( isSV()) {
  				std::string owner;
***************
*** 6310,6328 ****
  }
  
! void CCoreXmlFile::checkOutSVN( const std::string& p_file)
! {
! 	// todo simplify, streamline this
! 	if( applyLockSVN( p_file)) 
! 	{
! 		// not checked out by somebody else
! 	}
! 	else
! 	{
! 		ASSERT( 0);
! 		throw "checked out file";
! 	}
! }
  
! bool CCoreXmlFile::applyLockSVN( const std::string& p_file)
  {
  	bool succ = false;
--- 6376,6394 ----
  }
  
! //void CCoreXmlFile::checkOutSVN( const std::string& p_file)
! //{
! //	// todo simplify, streamline this
! //	if( applyLockSVN( p_file)) 
! //	{
! //		// not checked out by somebody else
! //	}
! //	else
! //	{
! //		ASSERT( 0);
! //		throw "checked out file";
! //	}
! //}
  
! bool CCoreXmlFile::applyLockSVN( const std::string& p_file) // throws
  {
  	bool succ = false;
***************
*** 6337,6341 ****
--- 6403,6410 ----
  
  	if( !succ)
+ 	{
  		AfxMessageBox( (p_file + " lock() returned false in applyLockSVN").c_str());
+ 		HR_THROW( E_FAIL);
+ 	}
  
  	return succ;

Index: SvnConfig.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/SvnConfig.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SvnConfig.h	13 Feb 2008 18:54:57 -0000	1.3
--- SvnConfig.h	15 Feb 2008 21:06:43 -0000	1.4
***************
*** 4,49 ****
  
  #if(USESVN)
! #define USENEON 1
! #define USESERF 0
  
! #ifdef _DEBUG
  
- #pragma comment(lib, "comsvcs.lib")
- #pragma comment(lib, "zlibstatD.lib")
- //#pragma comment(lib, "setargv.obj") // moved into .vcproj
  #pragma comment(lib, "advapi32.lib")
  #pragma comment(lib, "shfolder.lib")
  #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "libaprD.lib")
- #pragma comment(lib, "libaprutilD.lib")
- #pragma comment(lib, "libapriconvD.lib")
- #pragma comment(lib, "xmlD.lib")
- #pragma comment(lib, "libsvn_client-1D.lib")
- #pragma comment(lib, "libsvn_delta-1D.lib")
- #pragma comment(lib, "libsvn_diff-1D.lib")
- #pragma comment(lib, "libsvn_fs-1D.lib")
- #pragma comment(lib, "libsvn_fs_fs-1D.lib")
- #pragma comment(lib, "libsvn_ra-1D.lib")
- #pragma comment(lib, "libsvn_ra_dav-1D.lib")
- #pragma comment(lib, "libsvn_ra_local-1D.lib")
- #pragma comment(lib, "libsvn_ra_svn-1D.lib")
- #pragma comment(lib, "libsvn_repos-1D.lib")
- #pragma comment(lib, "libsvn_subr-1D.lib")
- #pragma comment(lib, "libsvn_wc-1D.lib")
- #pragma comment(lib, "libeay32D.lib")
- #pragma comment(lib, "ssleay32D.lib")
  
- #else
- //comsvcs.lib zlibstat.lib setargv.obj advapi32.lib shfolder.lib ws2_32.lib libneon.lib libapr.lib libaprutil.lib libapriconv.lib xml.lib libsvn_client-1.lib libsvn_delta-1.lib libsvn_diff-1.lib libsvn_fs-1.lib libsvn_fs_fs-1.lib libsvn_ra-1.lib libsvn_ra_dav-1.lib libsvn_ra_local-1.lib libsvn_ra_svn-1.lib libsvn_repos-1.lib libsvn_subr-1.lib libsvn_wc-1.lib libeay32.lib ssleay32.lib
- #pragma comment(lib, "comsvcs.lib")
- #pragma comment(lib, "zlibstat.lib")
- //#pragma comment(lib, "setargv.obj") // moved into the project file
- #pragma comment(lib, "advapi32.lib")
- #pragma comment(lib, "shfolder.lib")
- #pragma comment(lib, "ws2_32.lib")
  #pragma comment(lib, "libapr.lib")
  #pragma comment(lib, "libaprutil.lib")
  #pragma comment(lib, "libapriconv.lib")
  #pragma comment(lib, "xml.lib")
  #pragma comment(lib, "libsvn_client-1.lib")
  #pragma comment(lib, "libsvn_delta-1.lib")
--- 4,29 ----
  
  #if(USESVN)
! #define USENEON 0
! #define USESERF 1
  
! // make sure USESERF and USENEON are mutually exclusive:
! #if(USENEON)
! 	#if(USESERF)
! 		#error Error: USENEON and USESERF are both true. You should not use both NEON and SERF at the same time!
! 	#endif
! #endif
  
  #pragma comment(lib, "advapi32.lib")
  #pragma comment(lib, "shfolder.lib")
  #pragma comment(lib, "ws2_32.lib")
  
  #pragma comment(lib, "libapr.lib")
  #pragma comment(lib, "libaprutil.lib")
  #pragma comment(lib, "libapriconv.lib")
  #pragma comment(lib, "xml.lib")
+ 
+ #pragma comment(lib, "libeay32.lib")
+ #pragma comment(lib, "ssleay32.lib")
+ 
  #pragma comment(lib, "libsvn_client-1.lib")
  #pragma comment(lib, "libsvn_delta-1.lib")
***************
*** 52,56 ****
  #pragma comment(lib, "libsvn_fs_fs-1.lib")
  #pragma comment(lib, "libsvn_ra-1.lib")
- #pragma comment(lib, "libsvn_ra_dav-1.lib")
  #pragma comment(lib, "libsvn_ra_local-1.lib")
  #pragma comment(lib, "libsvn_ra_svn-1.lib")
--- 32,35 ----
***************
*** 58,82 ****
  #pragma comment(lib, "libsvn_subr-1.lib")
  #pragma comment(lib, "libsvn_wc-1.lib")
- #pragma comment(lib, "libeay32.lib") 
- #pragma comment(lib, "ssleay32.lib")
  
  #endif
  
  
  #if(USENEON)
! 
  	#ifdef _DEBUG
  		#pragma comment(lib, "libNeonD.lib")
  	#else
  		#pragma comment(lib, "libNeon.lib")
  	#endif
- 
  #endif
  
  #if(USESERF)
- 
  	#pragma comment(lib, "libsvn_ra_serf-1.lib")
  	#pragma comment(lib, "serf.lib")
- 
  #endif
  
--- 37,61 ----
  #pragma comment(lib, "libsvn_subr-1.lib")
  #pragma comment(lib, "libsvn_wc-1.lib")
  
+ #ifdef _DEBUG
+ 	#pragma comment(lib, "zlibstatD.lib")
+ #else
+ 	#pragma comment(lib, "zlibstat.lib")
  #endif
  
  
  #if(USENEON)
! 	#pragma comment(lib, "libsvn_ra_dav-1.lib")
  	#ifdef _DEBUG
  		#pragma comment(lib, "libNeonD.lib")
  	#else
  		#pragma comment(lib, "libNeon.lib")
+ 		#pragma message( "in this case set msvcrtd.lib with the NODEFAULTLIB linker option")
  	#endif
  #endif
  
  #if(USESERF)
  	#pragma comment(lib, "libsvn_ra_serf-1.lib")
  	#pragma comment(lib, "serf.lib")
  #endif
  

Index: SvnTester.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/SvnTester.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SvnTester.cpp	13 Feb 2008 18:54:57 -0000	1.3
--- SvnTester.cpp	15 Feb 2008 21:06:43 -0000	1.4
***************
*** 3,10 ****
  #include "stdafx.h"
  #include "SvnTester.h"
! #include "VSSLoginDlg.h"
  
  // CSvnTester
! 
  
  STDMETHODIMP CSvnTester::info(BSTR p_url, VARIANT_BOOL p_byAPI, VARIANT_BOOL p_recursive, BSTR* p_ptrResultMsg)
--- 3,11 ----
  #include "stdafx.h"
  #include "SvnTester.h"
! #include "SvnLoginDlg.h"
  
  // CSvnTester
! std::string g_storedUserName;
! std::string g_storedPassWord;
  
  STDMETHODIMP CSvnTester::info(BSTR p_url, VARIANT_BOOL p_byAPI, VARIANT_BOOL p_recursive, BSTR* p_ptrResultMsg)
***************
*** 527,543 ****
  bool CSvnTester::getLoginData()
  {
! 	CVSSLoginDlg dlg;
! 	dlg.m_user     = "";
! 	dlg.m_password = "";
! 	dlg.m_text = "Please provide at least your SVN username. Password can be later provided when it is asked by the server.";//You may provide default username/password in case the svn client will face an authentication challenge from the server. In case these are not provided you might be later prompted for the credentials required by the server.";
  	dlg.m_database = m_svnUrl.c_str();
! 	//dlg.m_project  = m_projectFileName.c_str();
  
  	if( dlg.DoModal() == IDOK )
  	{
! 		m_username = dlg.m_user;
! 		m_password = dlg.m_password;
  		return true;
  	}
  	if( dlg.wasAborted())
  		throw hresult_exception(E_FAIL);
--- 528,551 ----
  bool CSvnTester::getLoginData()
  {
! 	CSvnLoginDlg dlg( 1); // uname & passw
! 	dlg.m_user     = g_storedUserName.c_str();
! 	dlg.m_password = g_storedPassWord.c_str();
  	dlg.m_database = m_svnUrl.c_str();
! 	//dlg.disableSshOption() is not called on dlg
! 	// because we don't know too much about the 
! 	// parameters
  
  	if( dlg.DoModal() == IDOK )
  	{
! 		g_storedUserName = m_username = dlg.m_user;
! 		g_storedPassWord = m_password = dlg.m_password;
  		return true;
  	}
+ 	else
+ 	{
+ 		m_username = "";
+ 		m_password = "";
+ 	}
+ 
  	if( dlg.wasAborted())
  		throw hresult_exception(E_FAIL);

Index: SvnLoginDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/SvnLoginDlg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SvnLoginDlg.cpp	13 Feb 2008 18:54:57 -0000	1.1
--- SvnLoginDlg.cpp	15 Feb 2008 21:06:43 -0000	1.2
***************
*** 6,18 ****
  #include "XmlBackEnd.h"
  #include ".\SvnLoginDlg.h"
! 
  
  // SvnLoginDlg dialog
  
  IMPLEMENT_DYNAMIC(CSvnLoginDlg, CDialog)
! CSvnLoginDlg::CSvnLoginDlg(CWnd* pParent /*=NULL*/)
  	: CDialog(CSvnLoginDlg::IDD, pParent)
  	, m_aborted( false)
! 	, m_sshInitially( false)
  	, m_leftPad( 20)
  	, m_rightPad( 20)
--- 6,20 ----
  #include "XmlBackEnd.h"
  #include ".\SvnLoginDlg.h"
! #include <io.h>
! #include <fstream>
  
  // SvnLoginDlg dialog
  
  IMPLEMENT_DYNAMIC(CSvnLoginDlg, CDialog)
! CSvnLoginDlg::CSvnLoginDlg( int p_prefChoice, CWnd* pParent /*=NULL*/)
  	: CDialog(CSvnLoginDlg::IDD, pParent)
+ 	, m_prefChoice( p_prefChoice)
  	, m_aborted( false)
! 	, m_sshDisabled( false)
  	, m_leftPad( 20)
  	, m_rightPad( 20)
***************
*** 36,41 ****
  	DDX_Text(pDX, IDC_STATIC_DATABASE, m_database);
  	DDX_Text(pDX, IDC_STATIC_PROJECT, m_project);
! 	DDX_Control(pDX, IDC_RADIO_CACHED, m_loginMethod);
  	DDX_Control(pDX, IDC_EDIT_PWD, m_passwordCtrl);
  	DDX_Radio(pDX, IDC_RADIO_CACHED, m_credRadioBtn);
  }
--- 38,45 ----
  	DDX_Text(pDX, IDC_STATIC_DATABASE, m_database);
  	DDX_Text(pDX, IDC_STATIC_PROJECT, m_project);
! 	DDX_Control(pDX, IDC_RADIO_CACHED, m_radBtnLoginMethod);
! 	DDX_Control(pDX, IDC_EDIT_USER, m_userCtrl);
  	DDX_Control(pDX, IDC_EDIT_PWD, m_passwordCtrl);
+ 	DDX_Control(pDX, IDC_LOADFROMCACHE, m_btnLoadFromCache);
  	DDX_Radio(pDX, IDC_RADIO_CACHED, m_credRadioBtn);
  }
***************
*** 48,51 ****
--- 52,56 ----
  	ON_BN_CLICKED(IDC_RADIO_CACHED, OnBnClickedRadioCached)
  	ON_BN_CLICKED(IDC_RADIO_PPK, OnBnClickedRadioPpk)
+ 	ON_BN_CLICKED(IDC_LOADFROMCACHE, OnBnClickedLoadFromCache)
  END_MESSAGE_MAP()
  
***************
*** 75,86 ****
  {
  	CDialog::OnInitDialog();
  
! 	if( m_sshInitially) m_credRadioBtn = 2;
! 	else {
! 		m_credRadioBtn = 0;//m_loginMethod.SetCheck( BST_CHECKED);
! 		//m_passwordCtrl.EnableWindow( FALSE);
! 	}
! 	m_passwordCtrl.EnableWindow( FALSE);//either 0 or 2, m_loginMethod.GetCheck() != BST_CHECKED);
  
  	CWnd * db = GetDlgItem( IDC_STATIC_DATABASE);
  	CRect db_rect;
--- 80,94 ----
  {
  	CDialog::OnInitDialog();
+ 	
+ 	m_credRadioBtn = m_prefChoice;
  
! 	// turn off ppk in all cases except svn+ssh
! 	CWnd* ppk = GetDlgItem( IDC_RADIO_PPK);
! 	if( ppk) ppk->EnableWindow( !m_sshDisabled); // enable also if no url to decide upon
  
+ 	m_passwordCtrl.EnableWindow( FALSE);//either 0 or 2, m_radBtnLoginMethod.GetCheck() != BST_CHECKED);
+ 	m_btnLoadFromCache.EnableWindow( m_credRadioBtn == 0);
+ 
+ 	// wm_size related calculations
  	CWnd * db = GetDlgItem( IDC_STATIC_DATABASE);
  	CRect db_rect;
***************
*** 97,101 ****
  	}
  
! 	UpdateData(FALSE);
  
  	return TRUE;  // return TRUE unless you set the focus to a control
--- 105,109 ----
  	}
  
! 	UpdateData(FALSE); // send data modifications to controls
  
  	return TRUE;  // return TRUE unless you set the focus to a control
***************
*** 106,109 ****
--- 114,118 ----
  {
  	m_passwordCtrl.EnableWindow( TRUE);
+ 	m_btnLoadFromCache.EnableWindow( FALSE);
  }
  
***************
*** 111,114 ****
--- 120,124 ----
  {
  	m_passwordCtrl.EnableWindow( FALSE);
+ 	m_btnLoadFromCache.EnableWindow( TRUE);
  }
  
***************
*** 116,123 ****
  {
  	m_passwordCtrl.EnableWindow( FALSE);
! 	if( m_database.Left(10) != "svn+ssh://")
! 	{
! 		AfxMessageBox( "This is a valid option only for repositories accessed through svn+ssh:// protocol!");
! 	}
  }
  
--- 126,130 ----
  {
  	m_passwordCtrl.EnableWindow( FALSE);
! 	m_btnLoadFromCache.EnableWindow( FALSE);
  }
  
***************
*** 134,140 ****
  }
  
! void CSvnLoginDlg::setSshOptionInitially()
  {
! 	m_sshInitially = true;
  }
  
--- 141,296 ----
  }
  
! void CSvnLoginDlg::disableSshOption()
  {
! 	m_sshDisabled = true;
! }
! 
! bool CSvnLoginDlg::getDataFromCache( const std::string& p_inRealm, std::string& p_realm, std::string& p_uname)
! {
! // analyzing files as "C:\Documents and Settings\zolmol\Application Data\Subversion\auth\svn.simple\f061142afd1f61e24960515448599a09" 
! // with sample content below
! 	const char* svn_sim_path = "\\Subversion\\auth\\svn.simple";
! 	char        app_data_path[ _MAX_PATH];
! 	if( !SHGetSpecialFolderPath( NULL, app_data_path, CSIDL_APPDATA, true)) //most likely C:\Documents and Settings\<username>\Application Data
! 		return false;
! 
! 	if( 1)
! 	{
! 		char                 buf[_MAX_PATH];
! 		_finddata_t          fileInfo;
! 
! 		sprintf( buf, "%s%s\\*.", app_data_path, svn_sim_path);
! 
! 		long searchHandle = _findfirst( buf, &fileInfo );
! 		long ret = searchHandle;
! 		while( ret != -1 )
! 		{
! 			sprintf( buf, "%s%s\\%s", app_data_path, svn_sim_path, fileInfo.name );
! 
! 			std::string _realm;
! 			std::string _uname;
! 			if( loadCacheFile( buf, _realm, _uname))
! 			{
! 				std::string::size_type co_pos = _realm.find( ':');
! 				std::string::size_type rb_pos = _realm.find( '>');
! 				if( co_pos != std::string::npos && rb_pos != std::string::npos && co_pos < rb_pos)
! 					rb_pos = co_pos; // colon found indicating port number, so will cut right there
! 
! 				if( rb_pos != std::string::npos && _realm[0] == '<')
! 				{
! 					_realm = _realm.substr( 1, rb_pos - 1);
! 					if( p_inRealm.substr( 0, _realm.length()) == _realm) // found
! 					{
! 						p_realm = _realm;
! 						p_uname = _uname;
! 						return true;
! 					}
! 				}
! 			}
! 			
! 			ret = _findnext( searchHandle, &fileInfo );
! 		}
! 		_findclose( searchHandle );
! 	}
! 
! 	return false;
! }
! 
! bool CSvnLoginDlg::loadCacheFile( const char* p_fileNamePtr, std::string& p_realm, std::string& p_uname)
! {
! // sample content of a cache file:
! //...
! //K 15 
! //svn:realmstring
! //V 68
! //<https://svn.isis.vanderbilt.edu:443> testrepo username and password
! //K 8
! //username
! //V 7
! //zolmol2
! //END 
! 
! 	std::string value_realmstring;
! 	std::string value_username;
! 	bool        collecting_realmstring = false;
! 	bool        collecting_username    = false;
! 	bool        found_realmstring      = false;
! 	bool        found_username         = false;
! 
! 	enum TypeOfLine
! 	{
! 		KEY_INDICATOR
! 		,VAL_INDICATOR
! 		,KEY_STRING
! 		,VAL_STRING
! 	};
! 
! 	TypeOfLine t_of_ln = VAL_STRING;
! 	TypeOfLine t_of_prev_ln;
! 	{
! 		std::ifstream datafile;
! 		datafile.open( p_fileNamePtr, std::ios_base::in);
! 		if( datafile.is_open())
! 		{
! 			char buff[1024];
! 			while( datafile.getline( buff, 1024))
! 			{
! 				std::string line( buff);
! 				if( line.empty())
! 					continue;
! 
! 				t_of_prev_ln = t_of_ln;
! 				
! 				if( line.substr( 0, 2) == "K ")
! 					t_of_ln = KEY_INDICATOR;
! 				else if( line.substr( 0, 2) == "V ")
! 					t_of_ln = VAL_INDICATOR;
! 				else if( t_of_prev_ln == KEY_INDICATOR)
! 					t_of_ln = KEY_STRING;
! 				else if( t_of_prev_ln == VAL_INDICATOR)
! 					t_of_ln = VAL_STRING;
! 
! 				if( t_of_ln == KEY_STRING && 0 == line.find( "svn:realmstring"))
! 				{
! 					collecting_realmstring = true;
! 				}
! 				else if( t_of_ln == KEY_STRING && 0 == line.find( "username"))
! 				{
! 					collecting_username = true;
! 				}
! 
! 				if( t_of_ln == VAL_STRING)
! 				{
! 					if( collecting_realmstring)
! 						value_realmstring = line, collecting_realmstring = false, found_realmstring = true;
! 					if( collecting_username)
! 						value_username = line, collecting_username = false, found_username = true;
! 				}
! 			}
! 		}
! 		datafile.close();
! 	}
! 
! 	if( found_realmstring && found_username && !value_realmstring.empty() && !value_username.empty())
! 	{
! 		p_realm = value_realmstring;
! 		p_uname = value_username;
! 		return true;
! 	}
! 
! 	return false;
  }
  
+ void CSvnLoginDlg::OnBnClickedLoadFromCache()
+ {
+ 	std::string uname;
+ 	if( getDataFromCache( (LPCTSTR) m_database, std::string(), uname))
+ 	{
+ 		m_user = uname.c_str();
+ 		UpdateData( FALSE);
+ 		m_userCtrl.SetFocus(); // set the focus back to the username to allow a quick 'Enter' to be hit
+ 		m_userCtrl.SetSel( 0, m_userCtrl.LineLength());
+ 	}
+ 	else
+ 		AfxMessageBox( "Cached credentials were not found for this server!");
+ }

Index: resource.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/resource.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** resource.h	13 Feb 2008 18:54:57 -0000	1.5
--- resource.h	15 Feb 2008 21:06:43 -0000	1.6
***************
*** 4,7 ****
--- 4,8 ----
  //
  #define IDC_ABORT                       3
+ #define IDC_LOADFROMCACHE               4
  #define IDS_PROJNAME                    100
  #define IDS_COREXMLFILE_DESC            102



More information about the GME-commit mailing list