cvsshell-devel Mailing List for CvsShell (Page 5)
Status: Beta
Brought to you by:
stefanheimann
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(82) |
Apr
|
May
(14) |
Jun
(3) |
Jul
(27) |
Aug
(18) |
Sep
(10) |
Oct
(1) |
Nov
(8) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(63) |
May
(2) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2004 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stefan H. <ste...@us...> - 2002-09-15 21:33:41
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv31648 Modified Files: utils.py Log Message: improved testcases, updated documentation Index: utils.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/utils.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** utils.py 7 Aug 2002 21:37:12 -0000 1.13 --- utils.py 15 Sep 2002 21:33:39 -0000 1.14 *************** *** 117,122 **** def splitquoted(str, stripQuotes=0): """Splits str on whitespace except when a quoted string is ! encountered. ! # Example: splitquotes('foo "foo \"bar\""') => ['foo','"foo \"bar\""'] If stripQuotes evaluates to true, the quotation marks are removed. """ --- 117,122 ---- def splitquoted(str, stripQuotes=0): """Splits str on whitespace except when a quoted string is ! encountered. Both "'" and "'" may be used as quotation marks. ! Example: splitquoted('foo "foo \"bar\""') => ['foo','"foo \"bar\""'] If stripQuotes evaluates to true, the quotation marks are removed. """ *************** *** 188,191 **** --- 188,217 ---- if __name__ == '__main__': import unittest + + class SplitquotedTestCase(unittest.TestCase): + def setUp(self): + pass + def tearDown(self): + pass + def testEmpty(self): + self.assertEqual(splitquoted(''), []) + def testNoBlanks(self): + self.assertEqual(splitquoted('abcd'), ['abcd']) + self.assertEquals(splitquoted('"abcd"'), ['"abcd"']) + self.assertEquals(splitquoted("'abcd'"), ["'abcd'"]) + def testQuotedBlanks(self): + self.assertEqual(splitquoted('"Hello World"'), ['"Hello World"']) + self.assertEqual(splitquoted("'Hello World'"), ["'Hello World'"]) + def testEscapes(self): + self.assertEqual(splitquoted('"ab\\"c"'), ['"ab\\"c"']) + self.assertEqual(splitquoted("'ab\\'c'"), ["'ab\\'c'"]) + def testMixedQuotes(self): + self.assertEqual(splitquoted('"\'"'), ['"\'"']) + self.assertEqual(splitquoted("'\"'"), ["'\"'"]) + def testStripQuotes(self): + self.assertEqual(splitquoted('"Stefan"', 1), ['Stefan']) + self.assertEqual(splitquoted("'Stefan'", 1), ['Stefan']) + def testMixed(self): + self.assertEqual(splitquoted('a "b" c \'d\''), ['a','"b"','c',"'d'"]) class ParseNumberStrTestCase(unittest.TestCase): |
From: Stefan H. <ma...@st...> - 2002-08-16 12:26:16
|
Hi! I've just released CvsShell 0.3.1. It fixes some bugs on the windows platform and also a bug with the status command. It doesn't contain any other changes. Sorry for the inconvenience of releasing 0.3.1 only 12 hours after 0.3! Bye Stefan |
From: <no...@so...> - 2002-08-16 11:31:40
|
Bugs item #595751, was opened at 2002-08-15 23:47 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=595751&group_id=48175 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: status throws exception Initial Comment: if the status command is invoked with a argument, it throws a exception. Example: status index.html ---------------------------------------------------------------------- >Comment By: Stefan Heimann (stefanheimann) Date: 2002-08-16 13:31 Message: Logged In: YES user_id=327401 fixed in 0.3.1 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=595751&group_id=48175 |
From: <no...@so...> - 2002-08-15 21:47:54
|
Bugs item #595751, was opened at 2002-08-15 23:47 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=595751&group_id=48175 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: status throws exception Initial Comment: if the status command is invoked with a argument, it throws a exception. Example: status index.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=595751&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-08-15 21:42:20
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv28124/src Modified Files: cvs_cmds.py cvs_shell.py Log Message: last changes needed for release 0.3 Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** cvs_cmds.py 4 Aug 2002 17:28:42 -0000 1.15 --- cvs_cmds.py 15 Aug 2002 21:42:17 -0000 1.16 *************** *** 545,546 **** --- 545,591 ---- newRoot = app.readCvsRootFromFile() if newRoot is not None: app.setCvsRoot(newRoot) + + def replace(app, name, args): + """Replaces a file with a given revision. + + replace rev file + + rev : the revision to replace the file with + file: the file to replace""" + try: + (globOpts, opts, + myOpts, rest) = app.parseArgs(args, + app.getCmdToAllowedOpts().get(name, '')) + except getopt.GetoptError, msg: + app.printErr(msg) + return + l = rest.split() + if len(l) != 2: + app.printErr("Illegal arguments.") + return + rev, file = l[0], l[1] + def __doIt(e, filename): + e.status = Entry.S_MODIFIED + return filename + try: + ids = app.applyOnEntryList(file, __doIt) + if len(ids) != 1: + app.printErr("Illegal arguments.") + return + file = ids[0] + except utils.ParseError: pass + except AppError, msg: + app.printErr(msg) + return + opts = opts + ' -p -r %s %s' % (rev, file) + try: + content = app.runCvsCmd('update', globOpts=globOpts, args=opts) + except CvsError: return + if not content: + app.printErr('empty file from repository.') + return + try: + open(file,'w').writelines(content) + except IOError, msg: + app.printErr(msg) + Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** cvs_shell.py 7 Aug 2002 21:37:12 -0000 1.31 --- cvs_shell.py 15 Aug 2002 21:42:17 -0000 1.32 *************** *** 145,148 **** --- 145,152 ---- except ShellException: pass return + for c in cmd.split(';'): + self.evalSingleCommand(c) + + def evalSingleCommand(self, cmd): try: notEnclosed, enclosed = utils.split(cmd, '`') |
From: Stefan H. <ste...@us...> - 2002-08-15 21:42:20
|
Update of /cvsroot/cvsshell/cvsshell/etc In directory usw-pr-cvs1:/tmp/cvs-serv28124/etc Modified Files: cvsshell.ini Log Message: last changes needed for release 0.3 Index: cvsshell.ini =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/cvsshell.ini,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cvsshell.ini 4 Aug 2002 17:29:38 -0000 1.12 --- cvsshell.ini 15 Aug 2002 21:42:17 -0000 1.13 *************** *** 17,20 **** --- 17,21 ---- st, stat, status = cvs_cmds.status auto-root = cvs_cmds.toggleCvsRootAutoUpdate + replace = cvs_cmds.replace full-info = basic_cmds.toggleFullInfoLine auto-refresh = basic_cmds.setAutoRefresh *************** *** 24,28 **** section COMMAND_OPTIONS: ! up, upd, update, sim-update = AdD:r:fI:j:k:lRpPW: refresh = r ad, add, new = k:m: --- 25,29 ---- section COMMAND_OPTIONS: ! up, upd, update, sim-update, replace = AdD:r:fI:j:k:lRpPW: refresh = r ad, add, new = k:m: |
From: Stefan H. <ste...@us...> - 2002-08-15 21:42:20
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv28124 Modified Files: ChangeLog README ReleaseNotes index.html Log Message: last changes needed for release 0.3 Index: ChangeLog =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ChangeLog 29 Jul 2002 17:29:10 -0000 1.9 --- ChangeLog 15 Aug 2002 21:42:16 -0000 1.10 *************** *** 11,14 **** --- 11,16 ---- + Enhancements: + - new command: show-unmodified. The listing now filters all unmodified + files. With show-unmodified you can turn this filter on or off. - new command: refresh. refresh reads all files recursivly starting at a given directory (or the current working directory if none is given) *************** *** 22,25 **** --- 24,29 ---- - improved readline support: completion is now possible for more than one directory; commands are completed, too. + - new command: replace. replace retrieves a given revision of a file from + the repository and replaces the working copy with that revision + Changes: Index: README =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README 27 May 2002 08:31:57 -0000 1.6 --- README 15 Aug 2002 21:42:16 -0000 1.7 *************** *** 1,4 **** ! Welcome to CvsShell 0.2 ======================= --- 1,4 ---- ! Welcome to CvsShell 0.3 ======================= *************** *** 25,29 **** -------- ! * CvsShell prompts you for all arguments needed for executing a command. * Aliases for different cvsroots. * Listing of all modified files in the current directory tree. --- 25,30 ---- -------- ! * CvsShell prompts you for all arguments needed for executing a ! command. * Aliases for different cvsroots. * Listing of all modified files in the current directory tree. *************** *** 31,42 **** those files can be accessed using a numerical ID instead of a (typically long) pathname. ! * Output of external shell commands can be embedded in cvsshell commands. * IDs of files in the listing can be used in external shell commands. * Shortcuts for cvs commands: ! - Commit is automatically executed after an add or delete command (if you ! want to). ! - Renaming files with cvs is lenghty: you have the rename the file in the ! local filesystem, remove the old file, add the new file and commit your ! changes. With CvsShell, this is done with a single command. * New commands can be integrated easily into CvsShell. --- 32,45 ---- those files can be accessed using a numerical ID instead of a (typically long) pathname. ! * Output of external shell commands can be embedded in cvsshell ! commands. * IDs of files in the listing can be used in external shell commands. * Shortcuts for cvs commands: ! - Commit is automatically executed after an add or delete command ! (if you want to). ! - Renaming files with cvs is lenghty: you have the rename the file ! in the local filesystem, remove the old file, add the new file and ! commit your changes. With CvsShell, this is done with a single ! command. * New commands can be integrated easily into CvsShell. *************** *** 164,167 **** Feedback, enhancements and bug reports are very appreciated! ! CvsShell - a console based cvs client http://cvsshell.sourceforge.net --- 167,170 ---- Feedback, enhancements and bug reports are very appreciated! ! CvsShell - a console based cvs frontend http://cvsshell.sourceforge.net Index: ReleaseNotes =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ReleaseNotes,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReleaseNotes 27 May 2002 08:31:57 -0000 1.1 --- ReleaseNotes 15 Aug 2002 21:42:16 -0000 1.2 *************** *** 1,12 **** ! CvsShell 0.2 released! http://cvsshell.sourceforge.net ! CvsShell is a console-based cvs client. It provides convenient access to the cvs commands through a shell-like user interface. Features: ! * CvsShell prompts you for all arguments needed for executing a command. * Aliases for different cvsroots. * Listing of all modified files in the current directory tree. --- 1,16 ---- ! CvsShell 0.3 released! http://cvsshell.sourceforge.net ! CvsShell is a console-based cvs frontend. It provides convenient access to the cvs commands through a shell-like user interface. + Many features and improvements have been added in this release. Make + sure to have a look at the changelog. + Features: ! * CvsShell prompts you for all arguments needed for executing a ! command. * Aliases for different cvsroots. * Listing of all modified files in the current directory tree. *************** *** 14,25 **** those files can be accessed using a numerical ID instead of a (typically long) pathname. ! * Output of external shell commands can be embedded in cvsshell commands. * IDs of files in the listing can be used in external shell commands. * Shortcuts for cvs commands: ! - Commit is automatically executed after an add or delete command (if you ! want to). ! - Renaming files with cvs is lenghty: you have the rename the file in the ! local filesystem, remove the old file, add the new file and commit your ! changes. With CvsShell, this is done with a single command. * New commands can be integrated easily into CvsShell. --- 18,31 ---- those files can be accessed using a numerical ID instead of a (typically long) pathname. ! * Output of external shell commands can be embedded in cvsshell ! commands. * IDs of files in the listing can be used in external shell commands. * Shortcuts for cvs commands: ! - Commit is automatically executed after an add or delete command ! (if you want to). ! - Renaming files with cvs is lenghty: you have the rename the file ! in the local filesystem, remove the old file, add the new file and ! commit your changes. With CvsShell, this is done with a single ! command. * New commands can be integrated easily into CvsShell. Index: index.html =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.html 27 May 2002 08:31:57 -0000 1.5 --- index.html 15 Aug 2002 21:42:16 -0000 1.6 *************** *** 10,14 **** <p> CvsShell is a console-based cvs-client written in <a href="http://www.python.org">Python</a>. ! The current version is 0.2 (2002-05-27). Read the <a href="ChangeLog">change log</a> and the <a href="ReleaseNotes">release notes</a>. </p> --- 10,14 ---- <p> CvsShell is a console-based cvs-client written in <a href="http://www.python.org">Python</a>. ! The current version is 0.3 (2002-08-15). Read the <a href="ChangeLog">change log</a> and the <a href="ReleaseNotes">release notes</a>. </p> *************** *** 53,58 **** <h3>Release history:</h3> <ul> ! <li>0.2: 2002-05-27</li> ! <li>0.1: 2002-03-16</li> </ul> <hr> --- 53,60 ---- <h3>Release history:</h3> <ul> ! <li>0.3: 2002-08-15</li> ! <li>0.2.1: 2002-06-02</li> ! <li>0.2: 2002-05-27</li> ! <li>0.1: 2002-03-16</li> </ul> <hr> *************** *** 60,64 **** <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Mon May 27 09:51:38 CEST 2002 <!-- hhmts end --> <br> --- 62,66 ---- <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Thu Aug 15 23:15:35 CEST 2002 <!-- hhmts end --> <br> |
From: Stefan H. <ste...@us...> - 2002-08-15 21:42:19
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv28124/testing Modified Files: testcases.py Log Message: last changes needed for release 0.3 Index: testcases.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testcases.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testcases.py 7 Aug 2002 22:17:12 -0000 1.3 --- testcases.py 15 Aug 2002 21:42:17 -0000 1.4 *************** *** 143,146 **** --- 143,161 ---- self.assertPathEqual(workingDir, os.getcwd()) print 'end: testRecursiveRefreshWithoutArg' + + def testReplace1(self): + print 'start: testReplace1' + self.exe('refresh') + self.exe("commit -m 'not important' modified") + self.exe('replace 1.1 1') + self.assertEqual('you are the file modified', open('modified').read()) + self.exe('replace 20 modified') # should not throw an exception + + def testReplace2(self): + self.exe("commit -m 'not important' modified") + self.exe('replace 1.1 modified') + self.assertEqual('you are the file modified', open('modified').read()) + self.exe('replace 20 modified') # should not throw an exception + *************** *** 173,178 **** --- 188,201 ---- self.assert_(not os.path.exists(sdir)) + def testMultipleCommands(self): + self.assertEqual(None, self.cvsshell.listing) + self.exe("refresh ; echo 1 > dat1.txt; refresh; echo 2 > dat2.txt") + for file in ['dat1.txt', 'dat2.txt']: + self.assert_(os.path.exists(file)) + self.assert_(self.cvsshell.listing is not None) + if __name__ == '__main__': + rc = os.path.join(os.environ['HOME'], '.cvsshellrc') savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') savedHistory = os.path.join(os.environ['HOME'], '.cvsshell_history-saved') *************** *** 180,200 **** try: os.rename(history, savedHistory) ! except: pass ! try: ! os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) ! restoreRC = 1 ! except: ! restoreRC = 0 ! try: ! unittest.main() ! except: ! pass try: ! os.unlink(history) ! os.rename(savedHistory, history) ! except: pass ! if restoreRC: ! try: ! os.rename(savedRC,os.path.join(os.environ['HOME'], '.cvsshellrc')) ! except OSError, msg: ! print 'could not restore config file:', msg --- 203,213 ---- try: os.rename(history, savedHistory) ! import atexit ! atexit.register(lambda : os.rename(savedHistory, history)) ! except OSError: pass try: ! os.rename(rc, savedRC) ! import atexit ! atexit.register(lambda : os.rename(savedRC, rc)) ! except OSError: pass ! unittest.main() |
From: Stefan H. <ma...@st...> - 2002-08-15 21:33:58
|
CvsShell 0.3 released!! Many features and improvements have been added in this release. Make sure to have a look at the changelog. Bye Stefan |
From: Stefan H. <ste...@us...> - 2002-08-07 22:17:15
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv22446 Modified Files: testcases.py Log Message: adapt testcase because of some changes in basic_cmds. Index: testcases.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testcases.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testcases.py 4 Aug 2002 17:30:13 -0000 1.2 --- testcases.py 7 Aug 2002 22:17:12 -0000 1.3 *************** *** 106,113 **** self.exe('refresh') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), - (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), ! (Entry.S_OK, 'sample_dir', '.')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) --- 106,113 ---- self.exe('refresh') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), ! (Entry.S_OK, 'sample_dir', '.'), ! ('locally-deleted', 'deleted', '.')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) *************** *** 120,126 **** self.assert_(self.cvsshell.listing is not None) self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), - (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), ! (Entry.S_OK, 'not_modified', '.')]) self.assertPathEqual(os.path.join(workingDir, 'sample_dir'), self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) --- 120,126 ---- self.assert_(self.cvsshell.listing is not None) self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_MODIFIED, 'modified', '.'), ! (Entry.S_OK, 'not_modified', '.'), ! ('locally-deleted', 'deleted', '.')]) self.assertPathEqual(os.path.join(workingDir, 'sample_dir'), self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) *************** *** 132,143 **** self.exe('refresh -r') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), - (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), (Entry.S_OK, 'sample_dir', '.'), (Entry.S_UNKNOWN, 'new', './sample_dir'), - (Entry.S_DELETED, 'deleted', './sample_dir'), (Entry.S_MODIFIED, 'modified', './sample_dir'), ! (Entry.S_OK, 'not_modified', './sample_dir')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) --- 132,143 ---- self.exe('refresh -r') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), (Entry.S_OK, 'sample_dir', '.'), + ('locally-deleted', 'deleted', '.'), (Entry.S_UNKNOWN, 'new', './sample_dir'), (Entry.S_MODIFIED, 'modified', './sample_dir'), ! (Entry.S_OK, 'not_modified', './sample_dir'), ! ('locally-deleted', 'deleted', './sample_dir')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) *************** *** 154,160 **** self.exe('refresh') if withParen: ! self.exe('rm [[0,2]]') else: ! self.exe('rm 0,2') self.assert_(not os.path.exists(new)) self.assert_(not os.path.exists(mod)) --- 154,160 ---- self.exe('refresh') if withParen: ! self.exe('rm [[0,1]]') else: ! self.exe('rm 0,1') self.assert_(not os.path.exists(new)) self.assert_(not os.path.exists(mod)) *************** *** 170,174 **** self.assert_(os.path.exists(sdir)) self.exe('refresh') ! self.exe('rm -r [[4]]') self.assert_(not os.path.exists(sdir)) --- 170,174 ---- self.assert_(os.path.exists(sdir)) self.exe('refresh') ! self.exe('rm -r [[3]]') self.assert_(not os.path.exists(sdir)) *************** *** 178,182 **** savedHistory = os.path.join(os.environ['HOME'], '.cvsshell_history-saved') history = os.path.join(os.environ['HOME'], '.cvsshell_history') ! try: os.rename(history, savedHistory) except: pass try: --- 178,183 ---- savedHistory = os.path.join(os.environ['HOME'], '.cvsshell_history-saved') history = os.path.join(os.environ['HOME'], '.cvsshell_history') ! try: ! os.rename(history, savedHistory) except: pass try: *************** *** 185,191 **** except: restoreRC = 0 ! import profile ! import pstats ! unittest.main() try: os.unlink(history) --- 186,193 ---- except: restoreRC = 0 ! try: ! unittest.main() ! except: ! pass try: os.unlink(history) |
From: <no...@so...> - 2002-08-07 21:39:26
|
Bugs item #590596, was opened at 2002-08-03 21:46 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: IDs are not displayed correct Initial Comment: If the option ``show-unmodified'' is set to true, the ids in the listing are not shown correct. ---------------------------------------------------------------------- Comment By: Stefan Heimann (stefanheimann) Date: 2002-08-07 23:38 Message: Logged In: YES user_id=327401 fixed for 0.3 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 |
From: <no...@so...> - 2002-08-07 21:38:52
|
Bugs item #590596, was opened at 2002-08-03 21:46 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: IDs are not displayed correct Initial Comment: If the option ``show-unmodified'' is set to true, the ids in the listing are not shown correct. ---------------------------------------------------------------------- >Comment By: Stefan Heimann (stefanheimann) Date: 2002-08-07 23:38 Message: Logged In: YES user_id=327401 fixed for 0.3 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-08-07 21:37:15
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv2108 Modified Files: basic_cmds.py cvs_shell.py utils.py Log Message: * fixed bug with regular expression in CVS/Entries parser Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** basic_cmds.py 4 Aug 2002 17:28:13 -0000 1.22 --- basic_cmds.py 7 Aug 2002 21:37:12 -0000 1.23 *************** *** 135,140 **** fullname = os.path.join(dirname, name) if not os.path.exists(fullname): ! myEntries.append(Entry(dirname, name, Entry.S_DELETED)) else: ltstamp = os.path.getmtime(fullname) info = '%s (rd: %s, wd: %s)' % (revision, strftime(app.dateFormat, localtime(rtstamp)), --- 135,141 ---- fullname = os.path.join(dirname, name) if not os.path.exists(fullname): ! myEntries.append(Entry(dirname, name, 'locally-deleted')) else: + namesToProcess.remove(name) ltstamp = os.path.getmtime(fullname) info = '%s (rd: %s, wd: %s)' % (revision, strftime(app.dateFormat, localtime(rtstamp)), *************** *** 144,149 **** else: myEntries.append(Entry(dirname, name, Entry.S_MODIFIED, info)) - namesToProcess.remove(name) for name in cvsEntries[1].keys(): fullname = os.path.join(dirname, name) if not os.path.exists(fullname): --- 145,150 ---- else: myEntries.append(Entry(dirname, name, Entry.S_MODIFIED, info)) for name in cvsEntries[1].keys(): + namesToProcess.remove(name) fullname = os.path.join(dirname, name) if not os.path.exists(fullname): *************** *** 151,155 **** else: myEntries.append(Entry(dirname, name, Entry.S_OK)) - namesToProcess.remove(name) # only files not under CVS control are contained in names. for name in namesToProcess: --- 152,155 ---- Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** cvs_shell.py 4 Aug 2002 17:25:48 -0000 1.30 --- cvs_shell.py 7 Aug 2002 21:37:12 -0000 1.31 *************** *** 471,484 **** class Entry(GetSetProvider): ! S_NEW = 'N' # what's this?? ! S_ADDED = 'A' ! S_CONFLICT = 'C' ! S_MODIFIED = 'M' ! S_PATCHED = 'P' ! S_REMOVED = 'R' ! S_UPDATED = 'U' ! S_UNKNOWN = '?' S_OK = 'OK' # file on the sandbox is in sync with repository ! S_DELETED = 'D' # file scheduled for removal has been commited statusToColorKey = None def __init__(self, dir, name, status, info=''): --- 471,483 ---- class Entry(GetSetProvider): ! S_ADDED = 'A' # file was added to the repository but has not been commited ! S_CONFLICT = 'C' # there is a conflict between the repository revision and the working revison ! S_MODIFIED = 'M' # file was locally modified ! S_PATCHED = 'P' # file was patched by the server ! S_REMOVED = 'R' # file has been scheduled for removal, but has not been commited ! S_UPDATED = 'U' # file was updated by the server ! S_UNKNOWN = '?' # status is unknown S_OK = 'OK' # file on the sandbox is in sync with repository ! S_DELETED = 'D' # removal has been commited to the repository statusToColorKey = None def __init__(self, dir, name, status, info=''): Index: utils.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/utils.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** utils.py 29 Jul 2002 17:29:10 -0000 1.12 --- utils.py 7 Aug 2002 21:37:12 -0000 1.13 *************** *** 82,86 **** return result ! lineRe = re.compile(r'(?P<isdir>D?)/(?P<name>[^/]*)/(?P<revision>[^/]*)/(?P<mtime>[^/]*)//') def parseCvsEntries(dir): --- 82,86 ---- return result ! lineRe = re.compile(r'(?P<isdir>D?)/(?P<name>[^/]*)/(?P<revision>[^/]*)/(?P<mtime>[^/]*)/.*/') def parseCvsEntries(dir): |
From: Stefan H. <ste...@us...> - 2002-08-04 17:30:15
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv2058/testing Modified Files: testcases.py Log Message: more tests... Index: testcases.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testcases.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testcases.py 29 Jul 2002 17:36:49 -0000 1.1 --- testcases.py 4 Aug 2002 17:30:13 -0000 1.2 *************** *** 19,26 **** os.system(cmd) ! class RefreshTestCase(unittest.TestCase): def setUp(self): - print 'setUp' os.mkdir(thisDir) os.chdir(thisDir) --- 19,26 ---- os.system(cmd) ! ! class AbstractTestCase(unittest.TestCase): def setUp(self): os.mkdir(thisDir) os.chdir(thisDir) *************** *** 70,74 **** msg += ' Expected: <%s>, is: <%s>' % (expected, real) unittest.TestCase.assertEqual(self, expected, real, msg) ! def assertEntries(self, expected): entries = self.cvsshell.listing.entries --- 70,74 ---- msg += ' Expected: <%s>, is: <%s>' % (expected, real) unittest.TestCase.assertEqual(self, expected, real, msg) ! def assertEntries(self, expected): entries = self.cvsshell.listing.entries *************** *** 82,98 **** --- 82,106 ---- self.assertEqual(dir, entry.dir, "entry %s is not ok (dir)." % entry.name) i = i+1 + + + class RefreshTestCase(AbstractTestCase): def testRefreshInInvalidDir(self): + print 'start: testRefreshInInvalidDir' self.assertEqual(None, self.cvsshell.listing) os.chdir(thisDir) self.exe('refresh') self.assertEqual(None, self.cvsshell.listing) + print 'end: testRefreshInInvalidDir' def testRefreshWithInvalidArg(self): + print 'start: testRefreshWithInvalidArg' self.assertEqual(None, self.cvsshell.listing) self.exe('refresh foo42') self.assertEqual(None, self.cvsshell.listing) + print 'end: testRefreshWithInvalidArg' def testNonRecursiveRefreshWithoutArg(self): + print 'start: testRefreshWithInvalidArg' self.assertEqual(None, self.cvsshell.listing) self.exe('refresh') *************** *** 104,109 **** --- 112,119 ---- self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) + print 'stop: testRefreshWithInvalidArg' def testRefreshWithArg(self): + print 'start: testRefreshWithArg' self.assertEqual(None, self.cvsshell.listing) self.exe('refresh sample_dir') *************** *** 115,120 **** --- 125,132 ---- self.assertPathEqual(os.path.join(workingDir, 'sample_dir'), self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) + print 'end: testRefreshWithArg' def testRecursiveRefreshWithoutArg(self): + print 'start: testRecursiveRefreshWithoutArg' self.assertEqual(None, self.cvsshell.listing) self.exe('refresh -r') *************** *** 130,138 **** self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) ! if __name__ == '__main__': savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') try: os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) --- 142,183 ---- self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) ! print 'end: testRecursiveRefreshWithoutArg' ! + class ShellCommandsTest(AbstractTestCase): + + def _testEmbedIds1_2(self, withParen): + new = os.path.join(workingDir, fNew) + mod = os.path.join(workingDir, fModified) + self.assert_(os.path.exists(new)) + self.assert_(os.path.exists(mod)) + self.exe('refresh') + if withParen: + self.exe('rm [[0,2]]') + else: + self.exe('rm 0,2') + self.assert_(not os.path.exists(new)) + self.assert_(not os.path.exists(mod)) + + def testEmbedIds1(self): + self._testEmbedIds1_2(0) + + def testEmbedIds2(self): + self._testEmbedIds1_2(1) + + def testEmbedIds3(self): + sdir = os.path.join(workingDir, sampleDir) + self.assert_(os.path.exists(sdir)) + self.exe('refresh') + self.exe('rm -r [[4]]') + self.assert_(not os.path.exists(sdir)) + if __name__ == '__main__': savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') + savedHistory = os.path.join(os.environ['HOME'], '.cvsshell_history-saved') + history = os.path.join(os.environ['HOME'], '.cvsshell_history') + try: os.rename(history, savedHistory) + except: pass try: os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) *************** *** 140,144 **** --- 185,195 ---- except: restoreRC = 0 + import profile + import pstats unittest.main() + try: + os.unlink(history) + os.rename(savedHistory, history) + except: pass if restoreRC: try: |
From: Stefan H. <ste...@us...> - 2002-08-04 17:29:41
|
Update of /cvsroot/cvsshell/cvsshell/etc In directory usw-pr-cvs1:/tmp/cvs-serv1889/etc Modified Files: cvsshell.ini Log Message: added show-unmodified command Index: cvsshell.ini =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/cvsshell.ini,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cvsshell.ini 29 Jul 2002 17:29:10 -0000 1.11 --- cvsshell.ini 4 Aug 2002 17:29:38 -0000 1.12 *************** *** 20,23 **** --- 20,24 ---- auto-refresh = basic_cmds.setAutoRefresh refresh = basic_cmds.refresh + show-unmodified = basic_cmds.showUnmodified end |
From: Stefan H. <ste...@us...> - 2002-08-04 17:28:45
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv1639 Modified Files: cvs_cmds.py Log Message: changed ``up-to-date'' in status command into ``OK'' Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cvs_cmds.py 29 Jul 2002 17:29:10 -0000 1.14 --- cvs_cmds.py 4 Aug 2002 17:28:42 -0000 1.15 *************** *** 77,80 **** --- 77,81 ---- name = headRes.group('name') status = headRes.group('status').strip() + if status == 'up-to-date': status = Entry.S_OK i = i+1 # skip empty line workingRev = regexWorkingRev.search(lines[i]).group(1) |
From: Stefan H. <ste...@us...> - 2002-08-04 17:28:16
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv1520 Modified Files: basic_cmds.py Log Message: implemented show-unmodified command. Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** basic_cmds.py 29 Jul 2002 17:29:10 -0000 1.21 --- basic_cmds.py 4 Aug 2002 17:28:13 -0000 1.22 *************** *** 108,111 **** --- 108,121 ---- + def showUnmodified(app, name, args): + """Specifies if unmodified files are included in the listing. + If this option is set to `on', unmodified files are included in the listing. + Otherwise, unmodified files are hidden.""" + oldVal = app.showUnmodified + app.showUnmodified = app.toggle(oldVal, args) + if oldVal != app.showUnmodified: + app.printListing() + + def refresh(app, name, args): """Refresh the current listing. |
From: Stefan H. <ste...@us...> - 2002-08-04 17:25:51
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv32410 Modified Files: cvs_shell.py Log Message: fixed id-bug (sf-id: 590596) Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** cvs_shell.py 29 Jul 2002 17:29:10 -0000 1.29 --- cvs_shell.py 4 Aug 2002 17:25:48 -0000 1.30 *************** *** 91,94 **** --- 91,95 ---- self.completeableCommands = self.getAvailableCommands() self.dateFormat = '%Y-%m-%d %H:%M' + self.showUnmodified = 0 def postStart(self): *************** *** 183,207 **** self.setDirtyListing(1) # pare args as the could specify ids in the listing ! def __doIt(e, filename): ! return filename try: # ids only ! l = self.applyOnEntryList(args, __doIt) args = string.join(l) self.setDirtyListing(1) ! except utils.ParseError: ! # maybe ids mixed with other options (the ids are then enclosed in [[ ... ]] ! beg = args.find('[[') ! end = args.find(']]') ! if beg > 0 and end > beg: ! pre = args[:beg] ! post = args[end+2:] ! ids = args[beg+2 : end] ! try: ! l = self.applyOnEntryList(ids, __doIt) ! args = pre + string.join(l) + post ! self.setDirtyListing(1) ! except utilsParseError: pass ! except AppError, msg: pass try: self.shell('%s %s' % (name, args)) --- 184,207 ---- self.setDirtyListing(1) # pare args as the could specify ids in the listing ! doIt = lambda e, filename: filename try: # ids only ! l = self.applyOnEntryList(args, doIt) args = string.join(l) self.setDirtyListing(1) ! except utils.ParseError: pass ! except AppError, msg: pass ! # maybe ids mixed with other options (the ids are then enclosed in [[ ... ]] ! beg = args.find('[[') ! end = args.find(']]') ! if beg >= 0 and end > beg: ! pre = args[:beg] ! post = args[end+2:] ! ids = args[beg+2 : end] ! try: ! l = self.applyOnEntryList(ids, doIt) ! args = pre + string.join(l) + post ! self.setDirtyListing(1) ! except utilsParseError: pass try: self.shell('%s %s' % (name, args)) *************** *** 439,443 **** --- 439,448 ---- lines = [] self.app.printMsg('Root Directory: ' + os.path.abspath(self.rootDir)) + hidden = 0 for e in self.entries: + if e.status == Entry.S_OK and not self.app.showUnmodified: + hidden += 1 + id += 1 + continue newDir = e.dir if oldDir != newDir: *************** *** 456,459 **** --- 461,466 ---- if footer: lines.append(footer + '\n') + if hidden: + lines.append("%d files are unmodified.\nEnable the option `show-unmodified' to show these files.\n" % hidden) self.app.more(lines) |
From: <no...@so...> - 2002-08-03 19:46:58
|
Bugs item #590596, was opened at 2002-08-03 12:46 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: IDs are not displayed correct Initial Comment: If the option ``show-unmodified'' is set to true, the ids in the listing are not shown correct. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=590596&group_id=48175 |
From: <no...@so...> - 2002-07-30 17:04:08
|
Bugs item #588152, was opened at 2002-07-29 19:30 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=588152&group_id=48175 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: rm [[1,2]] does not work Initial Comment: [[1,2]] is not expanded to the correct filename ---------------------------------------------------------------------- >Comment By: Stefan Heimann (stefanheimann) Date: 2002-07-30 19:04 Message: Logged In: YES user_id=327401 fixed in 0.3 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=588152&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-07-29 17:36:52
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv17680/testing Added Files: testcases.py Log Message: --- NEW FILE: testcases.py --- #!/usr/bin/env python import unittest, os, sys sys.path.insert(0, os.path.join(os.getcwd(), sys.path[0], '..', 'src')) from cvs_shell import Listing, Entry, CvsShell thisDir = os.tmpnam() repository = os.path.join(thisDir, 'repository') workingDir = os.path.join(thisDir, 'workingDir') fNotModified = 'not_modified' fModified = 'modified' fDeleted = 'deleted' fNew = 'new' sampleDir = 'sample_dir' def system(cmd): print cmd os.system(cmd) class RefreshTestCase(unittest.TestCase): def setUp(self): print 'setUp' os.mkdir(thisDir) os.chdir(thisDir) map(os.mkdir, [repository, workingDir, os.path.join(workingDir, sampleDir)]) system('cvs -d %s init' % repository) def createFile(filename): absName = os.path.join(workingDir, filename) print absName f = open(absName, 'w') f.write('you are the file ' + filename) f.close() files = [fNotModified, fModified, fDeleted] map(createFile, files + map(os.path.join, [sampleDir]*3, files)) # python does not support currying os.chdir(workingDir) system("cvs -d %s import -m 'does not matter' workingDir tests start" % repository) system('rm -r %s' % workingDir) os.chdir(thisDir) system('cvs -d %s checkout workingDir' % repository) import time time.sleep(1) # wait one second, so that timestamp differs def modifyFiles(dir): os.chdir(dir) f = open(fModified, 'w') f.write('I am modified.') f.close() f = open(fNew, 'w') f.write('I am new.') f.close() os.remove(fDeleted) map(modifyFiles, [workingDir, os.path.join(workingDir, sampleDir)]) os.chdir(workingDir) self.cvsshell = CvsShell() self.cvsshell.listing = None self.cvsshell.batchMode = 1 def exe(self, cmd): self.cvsshell.evalCommand(cmd) def tearDown(self): os.system('rm -rf %s' % thisDir) def assertPathEqual(self, p1, p2): self.assertEqual(os.path.abspath(p1), os.path.abspath(p2)) def assertEqual(self, expected, real, msg=None): if msg is not None: msg += ' Expected: <%s>, is: <%s>' % (expected, real) unittest.TestCase.assertEqual(self, expected, real, msg) def assertEntries(self, expected): entries = self.cvsshell.listing.entries self.assertEqual(len(expected), len(entries)) i = 0 for (status, name, dir) in expected: entry = entries[i] self.assertEqual(status, entry.status, "entry %s is not ok (status)" % entry.name) self.assertEqual(name, entry.name, "entry %s is not ok (name)." % entry.name) self.assertEqual(dir, entry.dir, "entry %s is not ok (dir)." % entry.name) i = i+1 def testRefreshInInvalidDir(self): self.assertEqual(None, self.cvsshell.listing) os.chdir(thisDir) self.exe('refresh') self.assertEqual(None, self.cvsshell.listing) def testRefreshWithInvalidArg(self): self.assertEqual(None, self.cvsshell.listing) self.exe('refresh foo42') self.assertEqual(None, self.cvsshell.listing) def testNonRecursiveRefreshWithoutArg(self): self.assertEqual(None, self.cvsshell.listing) self.exe('refresh') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), (Entry.S_OK, 'sample_dir', '.')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) def testRefreshWithArg(self): self.assertEqual(None, self.cvsshell.listing) self.exe('refresh sample_dir') self.assert_(self.cvsshell.listing is not None) self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.')]) self.assertPathEqual(os.path.join(workingDir, 'sample_dir'), self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) def testRecursiveRefreshWithoutArg(self): self.assertEqual(None, self.cvsshell.listing) self.exe('refresh -r') self.assertEntries([(Entry.S_UNKNOWN, 'new', '.'), (Entry.S_DELETED, 'deleted', '.'), (Entry.S_MODIFIED, 'modified', '.'), (Entry.S_OK, 'not_modified', '.'), (Entry.S_OK, 'sample_dir', '.'), (Entry.S_UNKNOWN, 'new', './sample_dir'), (Entry.S_DELETED, 'deleted', './sample_dir'), (Entry.S_MODIFIED, 'modified', './sample_dir'), (Entry.S_OK, 'not_modified', './sample_dir')]) self.assertPathEqual(workingDir, self.cvsshell.listing.rootDir) self.assertPathEqual(workingDir, os.getcwd()) if __name__ == '__main__': savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') try: os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) restoreRC = 1 except: restoreRC = 0 unittest.main() if restoreRC: try: os.rename(savedRC,os.path.join(os.environ['HOME'], '.cvsshellrc')) except OSError, msg: print 'could not restore config file:', msg |
From: <no...@so...> - 2002-07-29 17:30:44
|
Bugs item #588152, was opened at 2002-07-29 10:30 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=588152&group_id=48175 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: rm [[1,2]] does not work Initial Comment: [[1,2]] is not expanded to the correct filename ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=452212&aid=588152&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-07-29 17:29:13
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv14130/src Modified Files: app.py basic_cmds.py cvs_cmds.py cvs_shell.py interactive_app.py parsing.py plugable_app.py utils.py Log Message: improved refresh command added unit-tests Index: app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/app.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** app.py 27 May 2002 07:32:29 -0000 1.13 --- app.py 29 Jul 2002 17:29:10 -0000 1.14 *************** *** 271,279 **** self.printMsg(self.copyright) self.printVMsg(self.name + ' started.') ! def stop(self): self.printVMsg(self.name + ' done.') def run(self): raise AppError, 'run must be redefined!' ! class ShellException(GetSetProvider): --- 271,282 ---- self.printMsg(self.copyright) self.printVMsg(self.name + ' started.') ! self.postStart() ! def stop(self): ! self.preStop() self.printVMsg(self.name + ' done.') def run(self): raise AppError, 'run must be redefined!' ! def postStart(self): pass ! def preStop(self): pass class ShellException(GetSetProvider): Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** basic_cmds.py 26 Jul 2002 16:35:37 -0000 1.20 --- basic_cmds.py 29 Jul 2002 17:29:10 -0000 1.21 *************** *** 20,24 **** ############################################################################### ! import os, string, re from cvs_shell import Listing, Entry --- 20,25 ---- ############################################################################### ! from __future__ import nested_scopes ! import os, string, re, utils from cvs_shell import Listing, Entry *************** *** 102,127 **** """Enable or disable automatic refresh of the local listing. If this option is set to `on', the local listing is refreshed ! after a command changed some information on the CVS server but not in the local listing.""" app.autoRefresh = app.toggle(app.autoRefresh, args) ! def scan(app, name, args): ! """Scans the local filesystem starting at the given directory and creates a listing. ! The server is not contacted, so the status of all files will be `unknown'.""" ! def visit(entries, dirname, names): if dirname.find('CVS') >= 0: return ! for name in names: if name.find('CVS') < 0: ! entries.append(Entry(dirname, name, Entry.S_UNKNOWN)) ! dir = '.' entries = [] ! if args != '': dir = args try: ! os.path.walk(dir, visit, entries) ! except OSError, msg: app.printErr(msg) ! app.setListing(Listing(app, dir, entries)) ! app.setDirtyListing(0) ! app.getListing().sortEntries() ! app.printListing() --- 103,183 ---- """Enable or disable automatic refresh of the local listing. If this option is set to `on', the local listing is refreshed ! after a command that changed some information on the CVS server but not in the local listing.""" app.autoRefresh = app.toggle(app.autoRefresh, args) ! ! def refresh(app, name, args): ! """Refresh the current listing. ! The command scans the given directory and creates a listing based on the ! information contained in the file CVS/Entries. If no directory is given, ! the current working directory is assumed. You can use the `-r' option ! to apply the command recursivly to all subdirectories. ! ! The abbreviation `rd' means `repository date', `wd' means `working date'.""" ! from time import strftime, localtime ! def visit(myEntries, dirname, names): ! namesToProcess = [x for x in names] if dirname.find('CVS') >= 0: return ! if 'CVS' in names: # directory under CVS control ! cvsEntries = utils.parseCvsEntries(dirname) ! for name, (revision, rtstamp) in cvsEntries[0].items(): ! fullname = os.path.join(dirname, name) ! if not os.path.exists(fullname): ! myEntries.append(Entry(dirname, name, Entry.S_DELETED)) ! else: ! ltstamp = os.path.getmtime(fullname) ! info = '%s (rd: %s, wd: %s)' % (revision, strftime(app.dateFormat, localtime(rtstamp)), ! strftime(app.dateFormat, localtime(ltstamp))) ! if ltstamp == rtstamp: ! myEntries.append(Entry(dirname, name, Entry.S_OK, info)) ! else: ! myEntries.append(Entry(dirname, name, Entry.S_MODIFIED, info)) ! namesToProcess.remove(name) ! for name in cvsEntries[1].keys(): ! fullname = os.path.join(dirname, name) ! if not os.path.exists(fullname): ! myEntries.append(Entry(dirname, name, Entry.S_DELETED)) ! else: ! myEntries.append(Entry(dirname, name, Entry.S_OK)) ! namesToProcess.remove(name) ! # only files not under CVS control are contained in names. ! for name in namesToProcess: if name.find('CVS') < 0: ! myEntries.append(Entry(dirname, name, Entry.S_UNKNOWN)) ! # ! args = args.split() ! recursive = 0 ! wDir = None ! for x in args: ! if x == '-r': ! if recursive: ! app.printErr('invalid arguments') ! return ! recursive = 1 ! else: ! if wDir: ! app.printErr('invalid arguments') ! return ! wDir = x entries = [] ! wDir = wDir or '.' try: ! if not os.path.exists(os.path.join(wDir, 'CVS')): ! app.printErr('directory is not under CVS control.') ! return ! oldDir = os.getcwd() ! os.chdir(wDir) ! if recursive: ! os.path.walk('.', visit, entries) ! else: ! visit(entries, '.', os.listdir('.')) ! app.setListing(Listing(app, wDir, entries)) ! app.setDirtyListing(0) ! app.getListing().sortEntries() ! app.printListing() ! os.chdir(oldDir) ! except (IOError, OSError), msg: app.printErr(msg) ! return Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** cvs_cmds.py 27 Jul 2002 09:05:38 -0000 1.13 --- cvs_cmds.py 29 Jul 2002 17:29:10 -0000 1.14 *************** *** 33,37 **** This command creates a listing with all checked out files and their status. The abbreviation `rr' stands for `repository revision', ! `wr' means working revision. The listing can be filtered by setting the variable --- 33,37 ---- This command creates a listing with all checked out files and their status. The abbreviation `rr' stands for `repository revision', ! `wr' means `working revision'. The listing can be filtered by setting the variable *************** *** 83,87 **** i = i+1 try: ! time = strftime('%Y-%m-%d %H:%M', gmtime(os.stat(os.path.join(os.getcwd(), dir, name))[stat.ST_MTIME])) except OSError: time = '' info = 'rr: ' + repRev + ', wr: ' + workingRev + ', ' + time --- 83,88 ---- i = i+1 try: ! time = strftime(app.dateFormat, ! gmtime(os.stat(os.path.join(os.getcwd(), dir, name))[stat.ST_MTIME])) except OSError: time = '' info = 'rr: ' + repRev + ', wr: ' + workingRev + ', ' + time Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** cvs_shell.py 27 Jul 2002 09:05:38 -0000 1.28 --- cvs_shell.py 29 Jul 2002 17:29:10 -0000 1.29 *************** *** 47,50 **** --- 47,51 ---- self.setCopyright(COPYRIGHT) self.setBugAddress(BUG_ADDRESS) + self.initCommands= [] self.initOptions([('v',"Print some extra information"), ('h',"Print this help message"), *************** *** 69,73 **** \s+""", re.VERBOSE) self.noListingErrMsg = """No listing found. ! You must run `update', `refresh' or `status' before using this command.""" self.cvsRoot = None self.cvsRootAutoUpdate = 0 --- 70,74 ---- \s+""", re.VERBOSE) self.noListingErrMsg = """No listing found. ! You must run `update', `sim-update', `refresh' or `status' before using this command.""" self.cvsRoot = None self.cvsRootAutoUpdate = 0 *************** *** 87,91 **** self.listingFilter = utils.splitquoted(self.configMap.get('filter','')) self.enableColor = self.configMap.get('colors', 'off') == 'on' ! def readCvsRootFromFile(self): --- 88,98 ---- self.listingFilter = utils.splitquoted(self.configMap.get('filter','')) self.enableColor = self.configMap.get('colors', 'off') == 'on' ! self.batchMode = 0 ! self.completeableCommands = self.getAvailableCommands() ! self.dateFormat = '%Y-%m-%d %H:%M' ! ! def postStart(self): ! for cmd in self.initCommands: ! self.evalCommand(cmd) def readCvsRootFromFile(self): *************** *** 221,225 **** raise AppError, \ "Illegal argument: One of lines or s must be given" ! if len(lines) <= numlines or not self.configMap.has_key('pager'): self.printMsg(s, nonl=1) else: --- 228,232 ---- raise AppError, \ "Illegal argument: One of lines or s must be given" ! if len(lines) <= numlines or not self.configMap.has_key('pager') or self.batchMode: self.printMsg(s, nonl=1) else: *************** *** 382,385 **** --- 389,393 ---- ############################## + class Listing(GetSetProvider): *************** *** 412,416 **** i = eval("cmp(x.%s, y.%s)" % (attr,attr)) if i != 0: return i ! return i except AttributeError: return -1 --- 420,424 ---- i = eval("cmp(x.%s, y.%s)" % (attr,attr)) if i != 0: return i ! return i except AttributeError: return -1 Index: interactive_app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/interactive_app.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** interactive_app.py 27 Jul 2002 14:55:08 -0000 1.12 --- interactive_app.py 29 Jul 2002 17:29:10 -0000 1.13 *************** *** 29,32 **** --- 29,33 ---- self.BREAK_REPL = 'BREAK_REPL' self.DEF_PATTERN = '%%def%%' + self.completeableCommands = [] try: import readline *************** *** 36,40 **** else: readline.parse_and_bind("tab: complete") ! readline.set_completer_delims(' \t\n`~!@#$%^&*()-=+[{]}\\|;:\'",<>?') def setHistoryFile(self,filename): --- 37,42 ---- else: readline.parse_and_bind("tab: complete") ! readline.set_completer_delims(' \t\n`~!@$%^&*()=+[{]}\\|;:\'",<>?') ! readline.set_completer(self.complete) def setHistoryFile(self,filename): *************** *** 97,100 **** --- 99,142 ---- else: return a + # taken from http://mail.python.org/pipermail/python-list/2002-July/114824.html + def completenames(self, text, line, begidx, endidx): + l = [x for x in self.completeableCommands if x.startswith(text)] + path = os.environ['PATH'].split(':') + textlen = len(text) + for dir in path: + try: + files = os.listdir(dir) + except: + continue + for file in files: + if textlen > 0 and file[:textlen] != text: + continue + if os.access(dir+'/'+file, os.X_OK): + l += [file] + return l + + # taken from the cmd class (this method was introduced in python 2.2) + def complete(self, text, state): + """Return the next possible completion for 'text'. + + If a command has not been entered, then complete against command list. + Otherwise try to call complete_<command> to get list of completions. + """ + if state == 0: + import readline + origline = readline.get_line_buffer() + line = origline.lstrip() + stripped = len(origline) - len(line) + begidx = readline.get_begidx() - stripped + endidx = readline.get_endidx() - stripped + if begidx>0: + self.completion_matches = [] + else: + self.completion_matches = self.completenames(text, line, begidx, endidx) + try: + return self.completion_matches[state] + except IndexError: + return None + def evalCommand(self, command): """Subclasses should override this method. Index: parsing.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/parsing.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** parsing.py 15 Mar 2002 10:37:53 -0000 1.3 --- parsing.py 29 Jul 2002 17:29:10 -0000 1.4 *************** *** 41,45 **** for x in lines: cmd = x[1] ! app.evalCommand(cmd) --- 41,45 ---- for x in lines: cmd = x[1] ! app.initCommands.append(cmd) Index: plugable_app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/plugable_app.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** plugable_app.py 15 Mar 2002 00:47:08 -0000 1.6 --- plugable_app.py 29 Jul 2002 17:29:10 -0000 1.7 *************** *** 117,120 **** --- 117,123 ---- self.printVMsg("registered command %s" % cmdName) + def getAvailableCommands(self): + """Returns a list of all command names that are currently registered""" + return self._cmdToFun.keys() Index: utils.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/utils.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** utils.py 26 Jul 2002 16:35:37 -0000 1.11 --- utils.py 29 Jul 2002 17:29:10 -0000 1.12 *************** *** 20,24 **** ############################################################################### ! import re from app import AppError --- 20,24 ---- ############################################################################### ! import sys, re, os, stat from app import AppError *************** *** 82,85 **** --- 82,114 ---- return result + lineRe = re.compile(r'(?P<isdir>D?)/(?P<name>[^/]*)/(?P<revision>[^/]*)/(?P<mtime>[^/]*)//') + + def parseCvsEntries(dir): + """Parses the CVS/Entries file contained in dir. + Returns a 2-tuple of dictionaries: + The first dict maps filenames to a 2-tuple containing the local revision number + as a string and the timestamp of this revision + The 2nd dict is a set (i.e. the values are None) and contains the directories. + Errors are propagated to the caller. + """ + from time import strptime + from calendar import timegm + p = os.path + filename = p.join(dir, 'CVS', 'Entries') + f = open(filename) + dirs = {} + files = {} + for line in f.readlines(): + result = lineRe.match(line) + if not result: continue + name = result.group('name') + if result.group('isdir'): + dirs[name] = None + else: + revision = result.group('revision') + repTime = timegm(strptime(result.group('mtime'))) + files[name] = (revision, repTime) + return files, dirs + doubleQ = r'"(?:[^"\\]+|\\.)*"' |
From: Stefan H. <ste...@us...> - 2002-07-29 17:29:13
|
Update of /cvsroot/cvsshell/cvsshell/etc In directory usw-pr-cvs1:/tmp/cvs-serv14130/etc Modified Files: cvsshell.ini default-cvsshellrc Log Message: improved refresh command added unit-tests Index: cvsshell.ini =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/cvsshell.ini,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cvsshell.ini 26 Jul 2002 16:35:37 -0000 1.10 --- cvsshell.ini 29 Jul 2002 17:29:10 -0000 1.11 *************** *** 4,8 **** cd = basic_cmds.changeDir up, upd, update = cvs_cmds.update ! refresh = cvs_cmds.simulateUpdate set-root = cvs_cmds.setCvsRoot read-root = cvs_cmds.readCvsRoot --- 4,8 ---- cd = basic_cmds.changeDir up, upd, update = cvs_cmds.update ! sim-update = cvs_cmds.simulateUpdate set-root = cvs_cmds.setCvsRoot read-root = cvs_cmds.readCvsRoot *************** *** 19,27 **** full-info = basic_cmds.toggleFullInfoLine auto-refresh = basic_cmds.setAutoRefresh ! scan = basic_cmds.scan end section COMMAND_OPTIONS: ! up, upd, update, refresh = AdD:r:fI:j:k:lRpPW: ad, add, new = k:m: ci, com, commit = flRF:m:nr: --- 19,28 ---- full-info = basic_cmds.toggleFullInfoLine auto-refresh = basic_cmds.setAutoRefresh ! refresh = basic_cmds.refresh end section COMMAND_OPTIONS: ! up, upd, update, sim-update = AdD:r:fI:j:k:lRpPW: ! refresh = r ad, add, new = k:m: ci, com, commit = flRF:m:nr: Index: default-cvsshellrc =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/default-cvsshellrc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** default-cvsshellrc 27 May 2002 07:38:54 -0000 1.10 --- default-cvsshellrc 29 Jul 2002 17:29:10 -0000 1.11 *************** *** 30,33 **** --- 30,34 ---- auto-root on auto-refresh on + refresh end |
From: Stefan H. <ste...@us...> - 2002-07-29 17:29:13
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv14130 Modified Files: ChangeLog Log Message: improved refresh command added unit-tests Index: ChangeLog =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChangeLog 27 Jul 2002 14:42:13 -0000 1.8 --- ChangeLog 29 Jul 2002 17:29:10 -0000 1.9 *************** *** 11,18 **** + Enhancements: ! - new command: scan. scan reads all files recursivly starting at a given directory (or the current working directory if none is given) and creates a directory listing without contacting the server. You can refer to the ids in the listing in all subsequent commands. - improved status/refresh/update command: you now can specify the directory to operate on. --- 11,19 ---- + Enhancements: ! - new command: refresh. refresh reads all files recursivly starting at a given directory (or the current working directory if none is given) and creates a directory listing without contacting the server. You can refer to the ids in the listing in all subsequent commands. + The old refresh command can be invoked with `sim-update' - improved status/refresh/update command: you now can specify the directory to operate on. *************** *** 20,24 **** the time of last modification is displayed, too. - improved readline support: completion is now possible for more than one ! directory * Version 0.2.1 --- 21,29 ---- the time of last modification is displayed, too. - improved readline support: completion is now possible for more than one ! directory; commands are completed, too. ! ! + Changes: ! - `refresh' is now called `sim-update' (see above) ! * Version 0.2.1 |