[Pysvnmanager-svn] SF.net SVN: pysvnmanager:[27] trunk
Status: Alpha
Brought to you by:
jiangx
From: <ji...@us...> - 2008-07-29 16:34:31
|
Revision: 27 http://pysvnmanager.svn.sourceforge.net/pysvnmanager/?rev=27&view=rev Author: jiangx Date: 2008-07-29 16:34:38 +0000 (Tue, 29 Jul 2008) Log Message: ----------- store ,v file into RCS directory; bug in last commit: remove continue Modified Paths: -------------- trunk/config/Makefile trunk/pysvnmanager/model/rcsbackup.py trunk/pysvnmanager/tests/test_rcs_backup.py trunk/pysvnmanager/websetup.py Added Paths: ----------- trunk/config/RCS/ Modified: trunk/config/Makefile =================================================================== --- trunk/config/Makefile 2008-07-29 15:36:46 UTC (rev 26) +++ trunk/config/Makefile 2008-07-29 16:34:38 UTC (rev 27) @@ -7,7 +7,7 @@ clean: @-rm $(CONFFILE) >/dev/null 2>&1 @-rm localconfig.pyc >/dev/null 2>&1 - @-rm *,v 2>&1 + @-rm -f *,v RCS/*,v 2>&1 %: $(SRCDIR)/%.in cp $< $@ Property changes on: trunk/config/RCS ___________________________________________________________________ Added: svn:ignore + *,v Modified: trunk/pysvnmanager/model/rcsbackup.py =================================================================== --- trunk/pysvnmanager/model/rcsbackup.py 2008-07-29 15:36:46 UTC (rev 26) +++ trunk/pysvnmanager/model/rcsbackup.py 2008-07-29 16:34:38 UTC (rev 27) @@ -12,8 +12,12 @@ #sys.setdefaultencoding('utf-8') def is_rcs_exist(wcfile): - rcsfile = wcfile+',v' - return os.access(rcsfile, os.F_OK) + wcpath = os.path.dirname(os.path.abspath(wcfile)) + if os.path.isdir(wcpath+'/RCS'): + rcsfile = wcpath+'/RCS/'+os.path.basename(wcfile)+',v' + else: + rcsfile = wcfile+',v' + return os.path.exists(rcsfile) def get_unicode(msg, escape=False): if isinstance(msg, basestring) and not isinstance(msg, unicode): @@ -54,7 +58,6 @@ for i in cmd: log.debug("Command: "+i) - continue try: buff = os.popen(i).read().strip() except Exception, e: Modified: trunk/pysvnmanager/tests/test_rcs_backup.py =================================================================== --- trunk/pysvnmanager/tests/test_rcs_backup.py 2008-07-29 15:36:46 UTC (rev 26) +++ trunk/pysvnmanager/tests/test_rcs_backup.py 2008-07-29 16:34:38 UTC (rev 27) @@ -13,11 +13,14 @@ class TestRcsBackup(TestController): wcfile = "%s/%s" % (os.path.dirname(os.path.abspath(__file__)), 'rcstest.txt') - rcsfile = wcfile+',v' + wcpath = os.path.dirname(os.path.abspath(wcfile)) + if os.path.isdir(wcpath+'/RCS'): + rcsfile = wcpath+'/RCS/'+os.path.basename(wcfile)+',v' + else: + rcsfile = wcfile+',v' #def __init__(self, *args): # super(TestController, self).__init__(*args) - def setUp(self): if os.access(self.wcfile, os.R_OK): @@ -25,7 +28,6 @@ if os.access(self.rcsfile, os.R_OK): os.remove(self.rcsfile) - def tearDown(self): if os.access(self.wcfile, os.R_OK): os.remove(self.wcfile) @@ -59,11 +61,13 @@ def testBackup(self): # Backup test. (rcs file not exist yet) self.writefile() + assert self.get_revision() == 1, self.get_revision() assert os.access(self.wcfile, os.R_OK) assert not os.access(self.rcsfile, os.R_OK) rcs.backup(self.wcfile) assert os.access(self.wcfile, os.R_OK) - assert os.access(self.rcsfile, os.R_OK) + assert os.path.exists(self.rcsfile) + assert os.access(self.rcsfile, os.R_OK), self.rcsfile # Backup test. (rcs exist already) self.writefile() Modified: trunk/pysvnmanager/websetup.py =================================================================== --- trunk/pysvnmanager/websetup.py 2008-07-29 15:36:46 UTC (rev 26) +++ trunk/pysvnmanager/websetup.py 2008-07-29 16:34:38 UTC (rev 27) @@ -20,6 +20,8 @@ if not os.path.exists(here+'/config'): os.mkdir(here+'/config') + if not os.path.exists(here+'/config/RCS'): + os.mkdir(here+'/config/RCS') filelist = ['svn.access', 'svn.passwd', 'localconfig.py'] for f in filelist: src = resource_filename('pysvnmanager', 'config/' + f+'.in') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |