cvsshell-devel Mailing List for CvsShell (Page 7)
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-05-27 08:08:09
|
Update of /cvsroot/cvsshell/cvsshell/etc In directory usw-pr-cvs1:/tmp/cvs-serv23433/etc Modified Files: cvsshell.ini default-cvsshellrc Log Message: Index: cvsshell.ini =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/cvsshell.ini,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cvsshell.ini 15 Mar 2002 20:23:02 -0000 1.8 --- cvsshell.ini 27 May 2002 07:38:52 -0000 1.9 *************** *** 5,11 **** up, upd, update = cvs_cmds.update refresh = cvs_cmds.simulateUpdate ! sr,set-root = cvs_cmds.setCvsRoot ! rr,read-root = cvs_cmds.readCvsRoot ! cr,clear-root = cvs_cmds.clearCvsRoot list = cvs_cmds.printListing ad, add, new = cvs_cmds.add --- 5,11 ---- up, upd, update = cvs_cmds.update refresh = cvs_cmds.simulateUpdate ! set-root = cvs_cmds.setCvsRoot ! read-root = cvs_cmds.readCvsRoot ! clear-root = cvs_cmds.clearCvsRoot list = cvs_cmds.printListing ad, add, new = cvs_cmds.add *************** *** 13,20 **** --- 13,22 ---- ci, com, commit = cvs_cmds.commit delete, remove = cvs_cmds.remove + rename = cvs_cmds.rename co, get, checkout = cvs_cmds.checkout st, stat, status = cvs_cmds.status auto-root = cvs_cmds.toggleCvsRootAutoUpdate full-info = basic_cmds.toggleFullInfoLine + auto-refresh = basic_cmds.setAutoRefresh end Index: default-cvsshellrc =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/default-cvsshellrc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** default-cvsshellrc 28 Mar 2002 21:39:11 -0000 1.9 --- default-cvsshellrc 27 May 2002 07:38:54 -0000 1.10 *************** *** 29,32 **** --- 29,33 ---- section INIT_CMDS: auto-root on + auto-refresh on end |
From: Stefan H. <ste...@us...> - 2002-05-27 08:08:08
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv24680 Modified Files: README Log Message: added documentation for the 'r' field in the prompt Index: README =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 16 Mar 2002 13:26:37 -0000 1.3 --- README 27 May 2002 07:41:56 -0000 1.4 *************** *** 48,55 **** -- stefan@kunz:~/cvsshell$ cvsshell ! CvsShell 0.1 Copyright 2002 Stefan Heimann (ma...@st...). This software is released under the GPL. ! {a} ~/cvsshell [:ext:ste...@cv...sshe...ceforge.net:/cvsroot/cvsshell] $ -- --- 48,55 ---- -- stefan@kunz:~/cvsshell$ cvsshell ! CvsShell 0.2 Copyright 2002 Stefan Heimann (ma...@st...). This software is released under the GPL. ! {ar} ~/cvsshell [:ext:ste...@cv...sshe...ceforge.net:/cvsroot/cvsshell] $ -- *************** *** 62,66 **** is actived, a uppercase letter signalize that the option has been deactived. Options: ! - a: automatic update of the cvsroot variable * The current working directory * The current cvsroot. --- 62,67 ---- is actived, a uppercase letter signalize that the option has been deactived. Options: ! - a: automatic update of the cvsroot variable ! - r: automatic refresh of the local listing * The current working directory * The current cvsroot. *************** *** 125,127 **** CvsShell - a console based cvs client ! http://cvsshell.sourceforge.net \ No newline at end of file --- 126,128 ---- CvsShell - a console based cvs client ! http://cvsshell.sourceforge.net |
From: Stefan H. <ste...@us...> - 2002-05-27 08:08:07
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv25863 Removed Files: install.py Log Message: removed temporarily to convert dos-newlines into unix-newlines --- install.py DELETED --- |
From: Stefan H. <ste...@us...> - 2002-05-27 08:08:03
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv21991 Modified Files: ChangeLog Log Message: ChangeLog should now be ready for the release Index: ChangeLog =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ChangeLog 28 Mar 2002 23:07:37 -0000 1.3 --- ChangeLog 27 May 2002 07:38:25 -0000 1.4 *************** *** 4,15 **** + New Features: + Bugfixes: + Enhancements: ! ! - etc/default-cvsshellrc: changed color settings ! ! + API Additions: ! ! - src/interactive_app.py: prompt supports default value for answer --- 4,27 ---- + New Features: + - Rename command. + - Automatic refresh of the file listing. This option can be turned on/off + with `auto-refresh on' or `auto-refresh off' + - Support for migration of cvsroot aliases from the old configuration file to + the new configurations file during the installation process. + - Shell commands can be embedded in cvsshell commands by enclosing them in + `...`. + Example: commit `find -name *.py` + - Commands can be sent directly to the underlying shell by prepending a '!'. + Bugfixes: + - Remove command now checks for existence before removing a file. + Enhancements: ! - Changed color settings. ! - Commit command asks you to continue if no files are given to commit ! to make sure not to commit a whole directory tree by mistake. ! ! + API Additions/Changes: ! - src/interactive_app.py: Prompt method now supports default value for answer. ! - src/app.py: shell method new raises a exception if the execution of the shell ! command fails. \ No newline at end of file |
From: <no...@so...> - 2002-05-27 07:56:39
|
Feature Requests item #531777, was opened at 2002-03-19 08:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531777&group_id=48175 Category: None Group: None >Status: Closed Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: Automatic refresh Initial Comment: It should be possible to configure a automatic refresh of the listing (if marked dirty) and a automatic redrawing of the listing. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531777&group_id=48175 |
From: <no...@so...> - 2002-05-27 07:55:44
|
Feature Requests item #531887, was opened at 2002-03-19 16:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531887&group_id=48175 Category: None Group: None >Status: Closed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Rename command Initial Comment: It should be possible to rename a file. 1.) mv old new 2.) cvs remove old 3.) cvs add new 4.) commit new ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531887&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-05-27 07:54:37
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv28367 Modified Files: README index.html Log Message: corrected some errors Index: README =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 27 May 2002 07:41:56 -0000 1.4 --- README 27 May 2002 07:54:34 -0000 1.5 *************** *** 1,4 **** ! Welcome to CvsShell 0.1 ======================= --- 1,4 ---- ! Welcome to CvsShell 0.2 ======================= Index: index.html =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.html 16 Mar 2002 13:30:50 -0000 1.3 --- index.html 27 May 2002 07:54:34 -0000 1.4 *************** *** 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.1 (2002-03-16). </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.2 (2002-05-27). </p> *************** *** 27,35 **** <p>You can view a screenshot <a href="images/screenshot.jpg">here</a>.</p> <hr> <address><a href="mailto:ma...@st...">Stefan Heimann</a></address> <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Sat Mar 16 14:30:05 CET 2002 <!-- hhmts end --> <br> --- 27,40 ---- <p>You can view a screenshot <a href="images/screenshot.jpg">here</a>.</p> + <p>Release history:</p> + <ul> + <li>0.2: 2002-05-27</li> + <li>0.1: 2002-03-16</li> + </ul> <hr> <address><a href="mailto:ma...@st...">Stefan Heimann</a></address> <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Mon May 27 09:51:38 CEST 2002 <!-- hhmts end --> <br> |
From: Stefan H. <ste...@us...> - 2002-05-27 07:46:39
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv26131 Added Files: install.py Log Message: re-added |
From: <no...@so...> - 2002-05-27 07:38:06
|
Bugs item #560963, was opened at 2002-05-27 00:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452212&aid=560963&group_id=48175 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: commit command changes status incorrect Initial Comment: The commit command changes the status of the local listing even if the user aborts the operation (for example by not specifying a commit message and choosing *abort in the next dialog) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452212&aid=560963&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-05-27 07:32:32
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv20797/src Modified Files: app.py basic_cmds.py configurable_app.py cvs_cmds.py cvs_shell.py utils.py Log Message: see ChangeLog Index: app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/app.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** app.py 16 Mar 2002 13:26:37 -0000 1.12 --- app.py 27 May 2002 07:32:29 -0000 1.13 *************** *** 221,233 **** if self.isVerbose(): self.printMsg(command) # how about ipc? ! if not fork: ! os.system(command) # run a shell cmd ! elif fork == 1: ! return os.popen(command, 'r').read() # get its output ! else: # readlines too? pipe = os.popen(command, 'w') pipe.write(inp) # send it input ! pipe.close() ! return None def main(self): --- 221,236 ---- if self.isVerbose(): self.printMsg(command) # how about ipc? ! if fork == 1: ! pipe = os.popen(command, 'r') ! res = pipe.read() ! else: pipe = os.popen(command, 'w') pipe.write(inp) # send it input ! res = None ! exitCode = pipe.close() ! if exitCode is not None: ! raise ShellException(exitCode) ! return res ! def main(self): *************** *** 273,274 **** --- 276,283 ---- raise AppError, 'run must be redefined!' + + class ShellException(GetSetProvider): + + def __init__(self, exitCode): + GetSetProvider.__init__(self) + self.exitCode = exitCode Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** basic_cmds.py 15 Mar 2002 18:58:00 -0000 1.18 --- basic_cmds.py 27 May 2002 07:32:29 -0000 1.19 *************** *** 98,99 **** --- 98,105 ---- + def setAutoRefresh(app, name, args): + """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) Index: configurable_app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/configurable_app.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** configurable_app.py 15 Mar 2002 09:43:51 -0000 1.7 --- configurable_app.py 27 May 2002 07:32:29 -0000 1.8 *************** *** 49,53 **** config file. If forceDefault is true, the default configfile will be used no matter if filename exists or not.""" ! if(forceDefault): try: os.unlink(filename) --- 49,53 ---- config file. If forceDefault is true, the default configfile will be used no matter if filename exists or not.""" ! if forceDefault: try: os.unlink(filename) *************** *** 60,66 **** import shutil shutil.copyfile(default,filename) - else: - f = open(self.configFile, 'w') - f.close() --- 60,63 ---- Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** cvs_cmds.py 15 Mar 2002 20:16:01 -0000 1.7 --- cvs_cmds.py 27 May 2002 07:32:29 -0000 1.8 *************** *** 61,65 **** if headRes and dir is None: raise InternalCvsError, "Parsing of status message failed: " \ ! "`dir' is not set when get file information." elif headRes: name = headRes.group('name') --- 61,65 ---- if headRes and dir is None: raise InternalCvsError, "Parsing of status message failed: " \ ! "`dir' is not set when getting file information." elif headRes: name = headRes.group('name') *************** *** 246,259 **** return if not rest: # commit without an argument ! try: ! if not app.getListing(): ! rootDir = '' ! else: ! rootDir = app.getListing().getRootDir() ! app.runCvsCmd('commit', rootDir=rootDir, ! globOpts=globOpts, args=opts, fork=0) ! app.setDirtyListing(1) ! except CvsError: pass ! return def __doIt(e,filename): if e.status == Entry.S_REMOVED: --- 246,268 ---- return if not rest: # commit without an argument ! answ = app.prompt("No files given. This will commit the whole directory\n" \ ! "tree starting from here. Answer `yes' if you want to do\n" ! "so, `no' to abort the operation or specify some files\n" ! "to operate on. ") ! if answ == 'no': ! return ! elif answ == 'yes': ! try: ! if not app.getListing(): ! rootDir = '' ! else: ! rootDir = app.getListing().getRootDir() ! app.runCvsCmd('commit', rootDir=rootDir, ! globOpts=globOpts, args=opts, fork=0) ! app.setDirtyListing(1) ! except CvsError: pass ! return ! else: ! rest = answ def __doIt(e,filename): if e.status == Entry.S_REMOVED: *************** *** 312,320 **** app.printMsg("Refusing the delete a directory: %s" % name) continue ! try: ! os.unlink(name) ! except OSError, msg: ! app.printErr(msg) ! # Hope that the file already has been removed filenames.append(os.path.join(e.dir, e.name)) e.status = Entry.S_REMOVED --- 321,330 ---- app.printMsg("Refusing the delete a directory: %s" % name) continue ! if os.access(name, os.F_OK): ! try: ! os.unlink(name) ! except OSError, msg: ! app.printErr(msg) ! continue filenames.append(os.path.join(e.dir, e.name)) e.status = Entry.S_REMOVED *************** *** 325,333 **** app.printMsg("Refusing the delete a directory: %s" % name) continue ! try: ! os.unlink(name) ! except OSError, msg: ! app.printErr(msg) ! # Hope that the file already has been removed filenames.append(name) except AppError, msg: --- 335,344 ---- app.printMsg("Refusing the delete a directory: %s" % name) continue ! if os.access(name, os.F_OK): ! try: ! os.unlink(name) ! except OSError, msg: ! app.printErr(msg) ! continue filenames.append(name) except AppError, msg: *************** *** 351,354 **** --- 362,448 ---- fork=0, args=args) except CvsError: pass + + + def rename(app, name, args): + """Renames a file in the repository. + You must specify the file to rename (the `source file') and the new name of + the file (the `target file'). The source file can be a filename or an id in + the listing. The filename of the target file may include the special variable + $OLD_DIR. This variable is replaced by the directory the source file resides + in. + You can invoke the command without any arguments as it prompts + you if needed.""" + specialVar = '$OLD_DIR' + srcText = 'enter filenumber/filename to rename: ' + dstText = 'enter new filename: ' + 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) == 0: + src = app.prompt(srcText) + if not src: return + dst = app.prompt(dstText) + elif len(l) == 1: + src = l[0] + dst = app.prompt(dstText) + elif len(l) != 2: + print 'Illegal arguments.' + return + else: + src = l[0] + dst = l[1] + if not dst: return + # + rootDir = '.' + listing = None + entry = None + try: + srcNum = int(src) + listing = app.getListing() + if listing is None: + app.printErr('Cannot resolve ID: no listing available.') + return + rootDir = listing.getRootDir() + entries = listing.getEntries() + if srcNum < 0 or srcNum >= len(entries): + app.printErrMsg('Illegal ID') + return + entry = entries[srcNum] + src = entry.getFullPath(listing) + oldDir = os.path.join(listing.getRootDir(), entry.getDir()) or '.' + dst = dst.replace(specialVar, oldDir) + except ValueError: + dst = dst.replace(specialVar, os.path.dirname(src) or '.') + app.printMsg('Rename: ' + src + ' => ' + dst) + answ = app.prompt('Are you sure (yes|no)? ') + if answ != 'yes': return + try: + os.renames(src, dst) + except OSError, msg: + app.printErr(msg) + return + try: + app.runCvsCmd('add', rootDir=rootDir, + fork=0, args=dst) + except CvsError: return + try: + app.runCvsCmd('remove', rootDir=rootDir, + fork=0, args=src) + except CvsError: return + answ = app.prompt("\nThe files have been scheduled for removal/addition.\n" \ + "Should I run `commit' to remove/add the files " \ + "permanently (yes|no)? ") + if answ == 'yes': + try: + args = dst + ' ' + src + app.runCvsCmd('commit', rootDir=rootDir, + fork=0, args=args) + if entry is not None: entry.status = Entry.S_DELETED + except CvsError: pass Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** cvs_shell.py 15 Mar 2002 19:46:08 -0000 1.23 --- cvs_shell.py 27 May 2002 07:32:29 -0000 1.24 *************** *** 1,2 **** --- 1,4 ---- + #!/usr/bin/env python2.1 + ############################################################################### # This file is part of CvsShell *************** *** 22,30 **** import os, sys, re, string, types, getopt, fnmatch, utils from oo_tools import GetSetProvider ! from app import AppError from interactive_app import InteractiveApp from plugable_app import PlugableApp ! VERSION = '0.1' NAME ='CvsShell' COPYRIGHT = 'Copyright 2002 Stefan Heimann (ma...@st...).\n' \ --- 24,32 ---- import os, sys, re, string, types, getopt, fnmatch, utils from oo_tools import GetSetProvider ! from app import AppError, ShellException from interactive_app import InteractiveApp from plugable_app import PlugableApp ! VERSION = '0.2' NAME ='CvsShell' COPYRIGHT = 'Copyright 2002 Stefan Heimann (ma...@st...).\n' \ *************** *** 73,76 **** --- 75,79 ---- self.listing = None self.dirtyListing = 1 + self.autoRefresh = 0 self.cvsRootAliases = {} self.configMap = {} *************** *** 94,100 **** --- 97,109 ---- def getPrompt(self): + if self.autoRefresh and self.dirtyListing and self.cvsRoot: + self.printMsg('getting listing from ' + self.cvsRoot) + self.evalCommand('refresh') + self.dirtyListing = 0 status = '' if self.cvsRootAutoUpdate: status += 'a' else: status += 'A' + if self.autoRefresh: status += 'r' + else: status += 'R' root = self.getCvsRoot() or '--' try: *************** *** 127,130 **** --- 136,161 ---- def evalCommand(self, cmd): + if len(cmd) > 0 and cmd[0] == '!': + try: + self.shell(cmd[1:]) + except ShellException: pass + return + try: + notEnclosed, enclosed = utils.split(cmd, '`') + except utils.SplitException, msg: + self.printErr(msg) + return + i = 0 + l = [] + for x in notEnclosed: + if x is not None: + l.append(x) + else: + c = enclosed[i] + i += 1 + try: + l.append(self.shell(c, fork=1)) + except ShellException: return + cmd = string.join(l) result = self.cmdRegex.match(cmd) if result is None: *************** *** 170,174 **** except utilsParseError: pass except AppError, msg: pass ! self.shell('%s %s' % (name, args)) --- 201,207 ---- except utilsParseError: pass except AppError, msg: pass ! try: ! self.shell('%s %s' % (name, args)) ! except ShellException: return *************** *** 443,446 **** --- 476,483 ---- return Entry.statusToColorKey.get(self.status, None) + def getFullPath(self, listing): + return os.path.join(listing.getRootDir(), self.dir, self.name) + + def main(): app = CvsShell() Index: utils.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/utils.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** utils.py 11 Mar 2002 12:02:14 -0000 1.9 --- utils.py 27 May 2002 07:32:29 -0000 1.10 *************** *** 83,88 **** res.append(x) # not only whitespace return res - ############################## --- 83,137 ---- res.append(x) # not only whitespace return res + + SplitException = 'SplitException' + + def split(str, delim): + """Splits str on occurences of delim. Returns a tupel with 2 elements: + 1: list that contains the parts of the string after splitting that + are not enclosed by delim. None marks a place where a substring + enclosed by delim would occur + 2: list that contains the substring that are enclosed by delim + (without the leading and trailing delim). + delim can be escaped with a backslash. The backslashes used for escaping + are removed from the result. + Example: split('\`foo\` `bar \`foo\``', '`', 1) ==> + (['`foo` ', None], ['bar `foo`']) + """ + notEnclosed = [] + enclosed = [] + current = '' + index = 0 + inside = 0 + n = len(str) + while index < n: + c = str[index] + index += 1 + if c == delim: + if inside: + enclosed.append(current) + notEnclosed.append(None) + else: + notEnclosed.append(current) + inside = not inside + current = '' + elif c == '\\': + c = str[index] + index += 1 + if c == delim: + current += delim + else: + current += '\\' + current += c + else: + current += c + if inside: + raise SplitException, "Unmatched '" + delim + "'" + elif current: + notEnclosed.append(current) + return (notEnclosed, enclosed) + + + ############################## *************** *** 93,97 **** import unittest ! class GetNumbersTestCase(unittest.TestCase): def setUp(self): pass --- 142,146 ---- import unittest ! class ParseNumberStrTestCase(unittest.TestCase): def setUp(self): pass *************** *** 99,118 **** pass def testEmpty(self): ! self.assertEqual(getNumbers(' '),[]) ! self.assertEqual(getNumbers(', ,,, '),[]) def testSimple(self): ! self.assertEqual(getNumbers(' 4 '),[4]) ! self.assertEqual(getNumbers('1 , 2,3 '),[1,2,3]) def testRanges(self): ! self.assertEqual(getNumbers('1 -4, 6 -8 , 10 , 12 - 13 '), [1,2,3,4,6,7,8,10,12,13]) def testNeg(self): ! self.assertEqual(getNumbers(' ! 2 '),[]) ! self.assertEqual(getNumbers(' !2, 2'),[2]) ! self.assertEqual(getNumbers('2, !2 '),[]) ! self.assertEqual(getNumbers('1-10, ! 5-7'), [1,2,3,4,8,9,10]) ! self.assertEqual(getNumbers('1-3, !2'), [1,3]) ! self.assertEqual(getNumbers('1-2, !2'), [1]) unittest.main() --- 148,186 ---- pass def testEmpty(self): ! self.assertEqual(parseNumberStr(' '),[]) ! self.assertEqual(parseNumberStr(', ,,, '),[]) def testSimple(self): ! self.assertEqual(parseNumberStr(' 4 '),[4]) ! self.assertEqual(parseNumberStr('1 , 2,3 '),[1,2,3]) def testRanges(self): ! self.assertEqual(parseNumberStr('1 -4, 6 -8 , 10 , 12 - 13 '), [1,2,3,4,6,7,8,10,12,13]) def testNeg(self): ! self.assertEqual(parseNumberStr(' ! 2 '),[]) ! self.assertEqual(parseNumberStr(' !2, 2'),[2]) ! self.assertEqual(parseNumberStr('2, !2 '),[]) ! self.assertEqual(parseNumberStr('1-10, ! 5-7'), [1,2,3,4,8,9,10]) ! self.assertEqual(parseNumberStr('1-3, !2'), [1,3]) ! self.assertEqual(parseNumberStr('1-2, !2'), [1]) + class SplitTestCase(unittest.TestCase): + def setUp(self): + pass + def tearDown(self): + pass + def testSimple(self): + self.assertEquals(split('hello world', "'"), (['hello world'],[])) + def testException(self): + try: + split('hallo "stefan ', '"') + self.fail('should raise a exception here.') + except SplitException: + pass + def testMe(self): + self.assertEqual(split('\`foo\` `bar \`foo\``', '`'), + (['`foo` ', None], ['bar `foo`'])) + def testMe2(self): + self.assertEqual(split('\`foo\` `bar \`foo\`` steven', '`'), + (['`foo` ', None, ' steven'], ['bar `foo`'])) unittest.main() |
From: Stefan H. <ste...@us...> - 2002-05-27 07:31:54
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv20566/testing Modified Files: refstderr refstdout testinput Log Message: Added some more tests Index: refstderr =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/refstderr,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** refstderr 27 May 2002 06:40:38 -0000 1.2 --- refstderr 27 May 2002 07:31:51 -0000 1.3 *************** *** 45,46 **** --- 45,51 ---- cvs remove: scheduling `renamed3' for removal cvs remove: use 'cvs commit' to remove this file permanently + find: invalid predicate `-' + find: invalid predicate `-' + cvs commit: Examining . + cvs commit: Examining dirX + cvs commit: Examining testdir Index: refstdout =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/refstdout,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** refstdout 27 May 2002 06:40:38 -0000 1.3 --- refstdout 27 May 2002 07:31:51 -0000 1.4 *************** *** 97,100 **** --- 97,101 ---- $ Aliases: enter new cvsroot: You can specify an alias for the cvsroot: enter name of module: cvs -d /tmp/cvsroot checkout testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 111,114 **** --- 112,116 ---- [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ enter name of module: cvs -d /tmp/cvsroot checkout testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 123,126 **** --- 125,129 ---- [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ cvs -d /tmp/cvsroot checkout testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 134,142 **** $ [0m[36m{ar} /tmp [--][0m $ echo === checkout 4 === ! [0m[36m{ar} /tmp [--][0m ! $ cvs -d /tmp/cvsroot checkout testdata ! [0m[36m{ar} /tmp [--][0m ! $ cd testdata ! ====== Testing commit ====== === commit 1 === Checking in test1; --- 137,141 ---- $ [0m[36m{ar} /tmp [--][0m $ echo === checkout 4 === ! [0m[36m{ar} ====== Testing commit ====== === commit 1 === Checking in test1; *************** *** 184,187 **** --- 183,191 ---- [01;34mtestdir[00m [m====== Testing remove ====== + /tmp [--][0m + $ cvs -d /tmp/cvsroot checkout testdata + [0m[36m{ar} /tmp [--][0m + $ cd testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 207,210 **** --- 211,215 ---- [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cvs -d /tmp/cvsroot commit -m 'this file was changed for testing' test1 + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 219,223 **** The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? cvs -q -d /tmp/cvsroot -n update -P Root Directory: /tmp/testdata : --- 224,229 ---- The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? getting listing from /tmp/cvsroot ! cvs -q -d /tmp/cvsroot -n update -P Root Directory: /tmp/testdata : *************** *** 249,253 **** The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? cvs -q -d /tmp/cvsroot -n update -P Root Directory: /tmp/testdata : --- 255,260 ---- The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? getting listing from /tmp/cvsroot ! cvs -q -d /tmp/cvsroot -n update -P Root Directory: /tmp/testdata : *************** *** 282,285 **** --- 289,293 ---- cvs -d /tmp/cvsroot -Q commit -m 'dummy' cd /tmp/testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 290,307 **** [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cvs -d /tmp/cvsroot status 2>&1 ! Root Directory: /tmp/testdata ! : ! 0 Up-to-date addtest1 ! 1 Up-to-date addtest2 ! 2 Up-to-date test1 ! 3 Up-to-date test2 ! dirX: ! 4 Up-to-date addtest3 ! 5 Up-to-date addtest4 ! testdir: ! 6 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ /tmp/testdata/test2 ! [00m[01;34mCVS[00m [00mI_AM_HERE.pyc[00m [00maddtest1[00m --- 298,302 ---- [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cvs -d /tmp/cvsroot status 2>&1 ! Roo[00m[01;34mCVS[00m [00mI_AM_HERE.pyc[00m [00maddtest1[00m *************** *** 338,351 **** new revision: delete; previous revision: 1.1 done ! RCS file: /tmp/cvsroot/testdata/renamed3,v ! done ! Checking in renamed3; ! /tmp/cvsroot/testdata/renamed3,v <-- renamed3 ! initial revision: 1.1 ! done ! Removing test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: delete; previous revision: 1.3 ! done cd /tmp/testdata cvs -d /tmp/cvsroot remove test2 --- 333,349 ---- new revision: delete; previous revision: 1.1 done ! t Directory: /tmp/testdata ! : ! 0 Up-to-date addtest1 ! 1 Up-to-date addtest2 ! 2 Up-to-date test1 ! 3 Up-to-date test2 ! dirX: ! 4 Up-to-date addtest3 ! 5 Up-to-date addtest4 ! testdir: ! 6 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ /tmp/testdata/test2 cd /tmp/testdata cvs -d /tmp/cvsroot remove test2 *************** *** 394,397 **** --- 392,396 ---- cvs -d /tmp/cvsroot commit -m 'test' cd /tmp/testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 424,427 **** --- 423,427 ---- cvs -d /tmp/cvsroot commit -m 'test' cd /tmp/testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 452,457 **** so, `no' to abort the operation or specify some files to operate on. cd /tmp/testdata ! cvs -d /tmp/cvsroot commit -m 'test' cd /tmp/testdata cvs -q -d /tmp/cvsroot -n update -P No entries available. --- 452,488 ---- so, `no' to abort the operation or specify some files to operate on. cd /tmp/testdata ! cvRCS file: /tmp/cvsroot/testdata/renamed3,v ! done ! Checking in renamed3; ! /tmp/cvsroot/testdata/renamed3,v <-- renamed3 ! initial revision: 1.1 ! done ! Removing test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: delete; previous revision: 1.3 ! done ! Removing renamed2; ! /tmp/cvsroot/testdata/renamed2,v <-- renamed2 ! new revision: delete; previous revision: 1.1 ! done ! Removing renamed3; ! /tmp/cvsroot/testdata/renamed3,v <-- renamed3 ! new revision: delete; previous revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/renamed5,v ! done ! Checking in renamed5; ! /tmp/cvsroot/testdata/renamed5,v <-- renamed5 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/renamed6,v ! done ! Checking in renamed6; ! /tmp/cvsroot/testdata/renamed6,v <-- renamed6 ! initial revision: 1.1 ! done ! s -d /tmp/cvsroot commit -m 'test' cd /tmp/testdata + getting listing from /tmp/cvsroot cvs -q -d /tmp/cvsroot -n update -P No entries available. *************** *** 479,482 **** --- 510,525 ---- The files have been scheduled for removal/addition. Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m + $ find . - + [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m + $ find . - + [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m + $ Unmatched '`' + [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m + $ find . -print + cvs -d /tmp/cvsroot commit -m 'test' . + getting listing from /tmp/cvsroot + cvs -q -d /tmp/cvsroot -n update -P + No entries available. + [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ rm -rf /tmp/testdata /tmp/cvsroot [0m[36m{ar} ERROR [/tmp/cvsroot][0m Index: testinput =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testinput,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testinput 27 May 2002 06:40:38 -0000 1.3 --- testinput 27 May 2002 07:31:51 -0000 1.4 *************** *** 117,120 **** --- 117,124 ---- yes no + !find . - + commit `find . -` + commit `find + commit -m 'test' `find . -print` rm -rf /tmp/testdata /tmp/cvsroot exit |
From: Stefan H. <ste...@us...> - 2002-05-27 06:40:41
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv5197/testing Modified Files: refstderr refstdout run-test.py testinput Log Message: added some testcases for the new functionality Index: refstderr =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/refstderr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** refstderr 10 Mar 2002 23:13:01 -0000 1.1 --- refstderr 27 May 2002 06:40:38 -0000 1.2 *************** *** 12,18 **** cvs add: scheduling file `addtest2' for addition cvs add: use 'cvs commit' to add this file permanently - cvs add: use 'cvs commit' to add these files permanently cvs remove: scheduling `test2' for removal cvs remove: use 'cvs commit' to remove this file permanently cvs remove: scheduling `addtest2' for removal cvs remove: use 'cvs commit' to remove this file permanently --- 12,46 ---- cvs add: scheduling file `addtest2' for addition cvs add: use 'cvs commit' to add this file permanently cvs remove: scheduling `test2' for removal cvs remove: use 'cvs commit' to remove this file permanently cvs remove: scheduling `addtest2' for removal + cvs remove: use 'cvs commit' to remove this file permanently + cvs add: scheduling file `/tmp/testdata/dirX/renamed' for addition + cvs add: use 'cvs commit' to add this file permanently + cvs remove: scheduling `/tmp/testdata/dirX/addtest3' for removal + cvs remove: use 'cvs commit' to remove this file permanently + cvs commit: Examining . + cvs commit: Examining dirX + cvs commit: Examining testdir + cvs add: scheduling file `renamed2' for addition + cvs add: use 'cvs commit' to add this file permanently + cvs remove: scheduling `/tmp/testdata/dirX/addtest4' for removal + cvs remove: use 'cvs commit' to remove this file permanently + cvs commit: Examining . + cvs commit: Examining dirX + cvs commit: Examining testdir + cvs add: scheduling file `/tmp/testdata//renamed3' for addition + cvs add: use 'cvs commit' to add this file permanently + cvs remove: scheduling `/tmp/testdata/test1' for removal + cvs remove: use 'cvs commit' to remove this file permanently + cvs commit: Examining . + cvs commit: Examining dirX + cvs commit: Examining testdir + cvs add: scheduling file `./renamed5' for addition + cvs add: use 'cvs commit' to add this file permanently + cvs remove: scheduling `renamed2' for removal + cvs remove: use 'cvs commit' to remove this file permanently + cvs add: scheduling file `renamed6' for addition + cvs add: use 'cvs commit' to add this file permanently + cvs remove: scheduling `renamed3' for removal cvs remove: use 'cvs commit' to remove this file permanently Index: refstdout =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/refstdout,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** refstdout 11 Mar 2002 12:02:15 -0000 1.2 --- refstdout 27 May 2002 06:40:38 -0000 1.3 *************** *** 2,8 **** ====== initializing the repository ====== ====== importing the testdata ====== - N testdata/I_AM_HERE.pyc N testdata/test1 N testdata/test2 N testdata/testdir/test3 --- 2,8 ---- ====== initializing the repository ====== ====== importing the testdata ====== N testdata/test1 N testdata/test2 + N testdata/I_AM_HERE.pyc N testdata/testdir/test3 *************** *** 14,242 **** === checkout 3 === === checkout 4 === ! ====== Testing commit ====== ! === commit 1 === ! Checking in test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: 1.2; previous revision: 1.1 ! done ! === commit 2 === ! Checking in test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: 1.3; previous revision: 1.2 ! done ! ====== Testing add ====== ! === add 1 === ! RCS file: /tmp/cvsroot/testdata/addtest1,v ! done ! Checking in addtest1; ! /tmp/cvsroot/testdata/addtest1,v <-- addtest1 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/addtest2,v ! done ! Checking in addtest2; ! /tmp/cvsroot/testdata/addtest2,v <-- addtest2 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/dirX/addtest3,v ! done ! Checking in dirX/addtest3; ! /tmp/cvsroot/testdata/dirX/addtest3,v <-- addtest3 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/dirX/addtest4,v ! done ! Checking in dirX/addtest4; ! /tmp/cvsroot/testdata/dirX/addtest4,v <-- addtest4 ! initial revision: 1.1 ! done ! CVS ! I_AM_HERE.pyc ! addtest1 ! addtest2 ! dirX ! test1 ! test2 ! testdir ! ====== Testing remove ====== ! CVS ! I_AM_HERE.pyc ! addtest1 ! dirX ! test1 ! testdir Default global options: ! {'upd': '-q', 'up': '-q', 'update': '-q'} Default options: ! {'upd': '-P', 'up': '-P', 'update': '-P'} Default global options for all cmds: '' Default options for all cmds: ! '-z 3' ! CvsShell 0.1 Copyright 2002 Stefan Heimann (ma...@st...). This software is released under the GPL. CvsShell started. ! {a} /private/tmp [--] $ cd /tmp ! {a} /private/tmp [--] $ echo ====== Creating testdata ======== ! {a} /private/tmp [--] $ mkdir testdata ! {a} /private/tmp [--] $ cd testdata ! {a} /private/tmp/testdata [--] $ echo "You are file test1" > test1 ! {a} /private/tmp/testdata [--] $ echo "You are file test2" > test2 ! {a} /private/tmp/testdata [--] $ echo "You are a file that should by filtered" > I_AM_HERE.pyc ! {a} /private/tmp/testdata [--] $ mkdir testdir ! {a} /private/tmp/testdata [--] $ echo "You are file test3" > testdir/test3 ! {a} /private/tmp/testdata [--] $ cd .. ! {a} /private/tmp [--] ! $ {a} /private/tmp [--] $ echo ====== initializing the repository ====== ! {a} /private/tmp [--] $ cvs -d /tmp/cvsroot init ! {a} /private/tmp [--] ! $ {a} /private/tmp [--] $ echo ====== importing the testdata ====== ! {a} /private/tmp [--] $ cd testdata ! {a} /private/tmp/testdata [--] $ cvs -d /tmp/cvsroot import -m "testdata" testdata stefan start ! {a} /private/tmp/testdata [--] $ cd .. ! {a} /private/tmp [--] $ rm -r testdata ! {a} /private/tmp [--] ! $ {a} /private/tmp [--] $ echo ====== testing checkout, set-root and clear-root ====== ! {a} /private/tmp [--] ! $ {a} /private/tmp [--] $ echo === checkout 1 === ! {a} /private/tmp [--] ! $ {a} /private/tmp [--] $ Aliases: ! enter new cvsroot: You can specify an alias for the cvsroot: enter name of module: cvs -z 3 -d /tmp/cvsroot checkout testdata ! {a} /private/tmp [/tmp/cvsroot] ! $ {a} /private/tmp [/tmp/cvsroot] $ cd testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] $ cd .. ! {a} /private/tmp [/tmp/cvsroot] $ rm -r testdata ! {a} /private/tmp [/tmp/cvsroot] ! $ {a} /private/tmp [/tmp/cvsroot] $ echo === checkout 2 === ! {a} /private/tmp [/tmp/cvsroot] ! $ enter name of module: cvs -z 3 -d /tmp/cvsroot checkout testdata ! {a} /private/tmp [/tmp/cvsroot] $ cd testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] $ cd .. ! {a} /private/tmp [/tmp/cvsroot] $ rm -r testdata ! {a} /private/tmp [/tmp/cvsroot] $ echo === checkout 3 === ! {a} /private/tmp [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot checkout testdata ! {a} /private/tmp [/tmp/cvsroot] $ cd testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] $ cd .. ! {a} /private/tmp [/tmp/cvsroot] $ rm -r testdata ! {a} /private/tmp [/tmp/cvsroot] ! $ {a} /private/tmp [--] $ echo === checkout 4 === ! {a} /private/tmp [--] ! $ cvs -z 3 -d /tmp/cvsroot checkout testdata ! {a} /private/tmp [--] $ cd testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo ====== Testing commit ====== ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo === commit 1 === ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo " changed" >> test1 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -q -d /tmp/cvsroot -n update -P : ! 0 M test1 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cd /private/tmp/testdata ! cvs -z 3 -d /tmp/cvsroot commit -m 'this file was changed for testing' test1 ! cd /private/tmp/testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo === commit 2 === ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo " changed" >> test1 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot commit -m 'this file was changed for testing' test1 ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo ====== Testing add ====== ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo === add 1 === ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo "I am addtest1" > addtest1 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot add addtest1 The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] $ echo "I am addtest2" > addtest2 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -q -d /tmp/cvsroot -n update -P : ! 0 A addtest1 ! 1 ? addtest2 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cd /private/tmp/testdata ! cvs -z 3 -d /tmp/cvsroot add -m 'sdfasdf' addtest2 : ! 0 A addtest2 ! The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] $ mkdir dirX ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo "I am addtest3" > dirX/addtest3 ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo "I am addtest4" > dirX/addtest4 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot -Q add -m 'sdfa' dirX The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -q -d /tmp/cvsroot update -P : ! 0 A addtest1 ! 1 A addtest2 ! dirX: ! 2 ? addtest3 ! 3 ? addtest4 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cd /private/tmp/testdata ! cvs -z 3 -d /tmp/cvsroot -Q add -m 'sdfas' dirX/addtest3 dirX/addtest4 dirX: ! 0 A addtest3 ! 1 A addtest4 ! The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cd /private/tmp/testdata ! cvs -z 3 -d /tmp/cvsroot -Q commit -m 'dummy' ! cd /private/tmp/testdata ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ ls ! {a} /private/tmp/testdata [/tmp/cvsroot] $ echo ====== Testing remove ====== ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot status 2>&1 : 0 Up-to-date addtest1 --- 14,294 ---- === checkout 3 === === checkout 4 === ! registered command ['exit'] ! registered command ['?', 'help'] ! registered command ['cd'] ! registered command ['up', 'upd', 'update'] ! registered command ['refresh'] ! registered command ['set-root'] ! registered command ['read-root'] ! registered command ['clear-root'] ! registered command ['list'] ! registered command ['ad', 'add', 'new'] ! registered command ['add-bin'] ! registered command ['ci', 'com', 'commit'] ! registered command ['delete', 'remove'] ! registered command ['rename'] ! registered command ['co', 'get', 'checkout'] ! registered command ['st', 'stat', 'status'] ! registered command ['auto-root'] ! registered command ['full-info'] ! registered command ['auto-refresh'] Default global options: ! {'up': '-q', 'upd': '-q', 'update': '-q'} Default options: ! {'up': '-P', 'upd': '-P', 'update': '-P'} Default global options for all cmds: '' Default options for all cmds: ! '' ! Aliases for cvsroots: ! {} ! Config options: ! {'color-updated': 'lblue', 'pager': 'more', 'color-patched': 'red', 'color-modified': 'green', 'color-added': 'purple', 'color-unknown': 'pink', 'colors': 'on', 'color-conflict': 'yellow', 'filter': '*.pyc *~', 'color-info': 'cyan'} ! Aliases: ! {'ls': 'ls --color=always'} ! CvsShell 0.2 Copyright 2002 Stefan Heimann (ma...@st...). This software is released under the GPL. CvsShell started. ! [0m[36m{ar} /tmp [--][0m $ cd /tmp ! [0m[36m{ar} /tmp [--][0m $ echo ====== Creating testdata ======== ! [0m[36m{ar} /tmp [--][0m $ mkdir testdata ! [0m[36m{ar} /tmp [--][0m $ cd testdata ! [0m[36m{ar} /tmp/testdata [--][0m $ echo "You are file test1" > test1 ! [0m[36m{ar} /tmp/testdata [--][0m $ echo "You are file test2" > test2 ! [0m[36m{ar} /tmp/testdata [--][0m $ echo "You are a file that should by filtered" > I_AM_HERE.pyc ! [0m[36m{ar} /tmp/testdata [--][0m $ mkdir testdir ! [0m[36m{ar} /tmp/testdata [--][0m $ echo "You are file test3" > testdir/test3 ! [0m[36m{ar} /tmp/testdata [--][0m $ cd .. ! [0m[36m{ar} /tmp [--][0m ! $ [0m[36m{ar} /tmp [--][0m $ echo ====== initializing the repository ====== ! [0m[36m{ar} /tmp [--][0m $ cvs -d /tmp/cvsroot init ! [0m[36m{ar} /tmp [--][0m ! $ [0m[36m{ar} /tmp [--][0m $ echo ====== importing the testdata ====== ! [0m[36m{ar} /tmp [--][0m $ cd testdata ! [0m[36m{ar} /tmp/testdata [--][0m $ cvs -d /tmp/cvsroot import -m "testdata" testdata stefan start ! [0m[36m{ar} /tmp/testdata [--][0m $ cd .. ! [0m[36m{ar} /tmp [--][0m $ rm -r testdata ! [0m[36m{ar} /tmp [--][0m ! $ [0m[36m{ar} /tmp [--][0m $ echo ====== testing checkout, set-root and clear-root ====== ! [0m[36m{ar} /tmp [--][0m ! $ [0m[36m{ar} /tmp [--][0m $ echo === checkout 1 === ! [0m[36m{ar} /tmp [--][0m ! $ [0m[36m{ar} /tmp [--][0m $ Aliases: ! enter new cvsroot: You can specify an alias for the cvsroot: enter name of module: cvs -d /tmp/cvsroot checkout testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m ! $ [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ cd testdata ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cd .. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ rm -r testdata ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m ! $ [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ echo === checkout 2 === ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m ! $ enter name of module: cvs -d /tmp/cvsroot checkout testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ cd testdata ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cd .. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ rm -r testdata ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ echo === checkout 3 === ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot checkout testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ cd testdata ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ cd .. ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m $ rm -r testdata ! [0m[36m{ar} /tmp [/tmp/cvsroot][0m ! $ [0m[36m{ar} /tmp [--][0m $ echo === checkout 4 === ! [0m[36m{ar} /tmp [--][0m ! $ cvs -d /tmp/cvsroot checkout testdata ! [0m[36m{ar} /tmp [--][0m $ cd testdata ! ====== Testing commit ====== ! === commit 1 === ! Checking in test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: 1.2; previous revision: 1.1 ! done ! === commit 2 === ! Checking in test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: 1.3; previous revision: 1.2 ! done ! ====== Testing add ====== ! === add 1 === ! RCS file: /tmp/cvsroot/testdata/addtest1,v ! done ! Checking in addtest1; ! /tmp/cvsroot/testdata/addtest1,v <-- addtest1 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/addtest2,v ! done ! Checking in addtest2; ! /tmp/cvsroot/testdata/addtest2,v <-- addtest2 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/dirX/addtest3,v ! done ! Checking in dirX/addtest3; ! /tmp/cvsroot/testdata/dirX/addtest3,v <-- addtest3 ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/dirX/addtest4,v ! done ! Checking in dirX/addtest4; ! /tmp/cvsroot/testdata/dirX/addtest4,v <-- addtest4 ! initial revision: 1.1 ! done ! [00m[01;34mCVS[00m ! [00mI_AM_HERE.pyc[00m ! [00maddtest1[00m ! [00maddtest2[00m ! [01;34mdirX[00m ! [00mtest1[00m ! [00mtest2[00m ! [01;34mtestdir[00m ! [m====== Testing remove ====== ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo ====== Testing commit ====== ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo === commit 1 === ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo " changed" >> test1 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -q -d /tmp/cvsroot -n update -P ! Root Directory: /tmp/testdata : ! [0m[32m 0 M test1 ! [0m[0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cd /tmp/testdata ! cvs -d /tmp/cvsroot commit -m 'this file was changed for testing' test1 ! cd /tmp/testdata ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo === commit 2 === ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo " changed" >> test1 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot commit -m 'this file was changed for testing' test1 ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo ====== Testing add ====== ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo === add 1 === ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo "I am addtest1" > addtest1 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot add addtest1 The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? cvs -q -d /tmp/cvsroot -n update -P ! Root Directory: /tmp/testdata ! : ! [0m[35m 0 A addtest1 ! [0m[0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo "I am addtest2" > addtest2 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -q -d /tmp/cvsroot -n update -P ! Root Directory: /tmp/testdata : ! [0m[35m 0 A addtest1 ! [0m[0m[1;35m 1 ? addtest2 ! [0m[0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cd /tmp/testdata ! cvs -d /tmp/cvsroot add -m 'sdfasdf' addtest2 ! Root Directory: /tmp/testdata : ! [0m[35m 0 A addtest2 ! [0m The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ mkdir dirX ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo "I am addtest3" > dirX/addtest3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo "I am addtest4" > dirX/addtest4 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot -Q add -m 'sdfa' dirX The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? cvs -q -d /tmp/cvsroot -n update -P ! Root Directory: /tmp/testdata : ! [0m[35m 0 A addtest1 ! [0m[0m[35m 1 A addtest2 ! [0mdirX: ! [0m[1;35m 2 ? addtest3 ! [0m[0m[1;35m 3 ? addtest4 ! [0m[0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -q -d /tmp/cvsroot update -P ! Root Directory: /tmp/testdata ! : ! [0m[35m 0 A addtest1 ! [0m[0m[35m 1 A addtest2 ! [0mdirX: ! [0m[1;35m 2 ? addtest3 ! [0m[0m[1;35m 3 ? addtest4 ! [0m[0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cd /tmp/testdata ! cvs -d /tmp/cvsroot -Q add -m 'sdfas' dirX/addtest3 dirX/addtest4 ! Root Directory: /tmp/testdata dirX: ! [0m[35m 0 A addtest3 ! [0m[0m[35m 1 A addtest4 ! [0m The files have been scheduled for addition. ! Should I run `commit' to add the files to the repository (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ No files given. This will commit the whole directory ! tree starting from here. Answer `yes' if you want to do ! so, `no' to abort the operation or specify some files ! to operate on. cd /tmp/testdata ! cvs -d /tmp/cvsroot -Q commit -m 'dummy' ! cd /tmp/testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ ls --color=always ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ echo ====== Testing remove ====== ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot status 2>&1 ! Root Directory: /tmp/testdata : 0 Up-to-date addtest1 *************** *** 249,273 **** testdir: 6 Up-to-date test3 ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ /private/tmp/testdata/test2 ! cd /private/tmp/testdata ! cvs -z 3 -d /tmp/cvsroot remove test2 : 0 R test2 The files have been scheduled for removal. ! Should I run `commit' to remove the files permanently (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cvs -z 3 -d /tmp/cvsroot remove addtest2 The files have been scheduled for removal. ! Should I run `commit' to remove the files permanently (yes|no)? {a} /private/tmp/testdata [/tmp/cvsroot] ! $ {a} /private/tmp/testdata [/tmp/cvsroot] $ Refusing the delete a directory: dirX ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ ls ! {a} /private/tmp/testdata [/tmp/cvsroot] ! $ cd /Users/stefan ! {a} ~ [/tmp/cvsroot] $ rm -rf /tmp/testdata /tmp/cvsroot ! {a} ~ [/tmp/cvsroot] $ CvsShell done. --- 301,483 ---- testdir: 6 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ /tmp/testdata/test2 ! [00m[01;34mCVS[00m ! [00mI_AM_HERE.pyc[00m ! [00maddtest1[00m ! [01;34mdirX[00m ! [00mtest1[00m ! [01;34mtestdir[00m ! [m====== Testing rename ==== ! Removing addtest2; ! /tmp/cvsroot/testdata/addtest2,v <-- addtest2 ! new revision: delete; previous revision: 1.1 ! done ! Removing test2; ! /tmp/cvsroot/testdata/test2,v <-- test2 ! new revision: delete; previous revision: 1.1.1.1 ! done ! Removing dirX/addtest3; ! /tmp/cvsroot/testdata/dirX/addtest3,v <-- addtest3 ! new revision: delete; previous revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/dirX/renamed,v ! done ! Checking in dirX/renamed; ! /tmp/cvsroot/testdata/dirX/renamed,v <-- renamed ! initial revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/renamed2,v ! done ! Checking in renamed2; ! /tmp/cvsroot/testdata/renamed2,v <-- renamed2 ! initial revision: 1.1 ! done ! Removing dirX/addtest4; ! /tmp/cvsroot/testdata/dirX/addtest4,v <-- addtest4 ! new revision: delete; previous revision: 1.1 ! done ! RCS file: /tmp/cvsroot/testdata/renamed3,v ! done ! Checking in renamed3; ! /tmp/cvsroot/testdata/renamed3,v <-- renamed3 ! initial revision: 1.1 ! done ! Removing test1; ! /tmp/cvsroot/testdata/test1,v <-- test1 ! new revision: delete; previous revision: 1.3 ! done ! cd /tmp/testdata ! cvs -d /tmp/cvsroot remove test2 ! Root Directory: /tmp/testdata : 0 R test2 The files have been scheduled for removal. ! Should I run `commit' to remove the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot remove addtest2 The files have been scheduled for removal. ! Should I run `commit' to remove the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ Refusing the delete a directory: dirX ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ ls --color=always ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ echo ====== Testing rename ==== ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot status 2>&1 ! Root Directory: /tmp/testdata ! : ! 0 Up-to-date addtest1 ! 1 Up-to-date test1 ! dirX: ! 2 Up-to-date addtest3 ! 3 Up-to-date addtest4 ! testdir: ! 4 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ Rename: /tmp/testdata/dirX/addtest3 => /tmp/testdata/dirX/renamed ! Are you sure (yes|no)? cd /tmp/testdata ! cvs -d /tmp/cvsroot add /tmp/testdata/dirX/renamed ! cd /tmp/testdata ! cd /tmp/testdata ! cvs -d /tmp/cvsroot remove /tmp/testdata/dirX/addtest3 ! cd /tmp/testdata ! ! The files have been scheduled for removal/addition. ! Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ No files given. This will commit the whole directory ! tree starting from here. Answer `yes' if you want to do ! so, `no' to abort the operation or specify some files ! to operate on. cd /tmp/testdata ! cvs -d /tmp/cvsroot commit -m 'test' ! cd /tmp/testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot status 2>&1 ! Root Directory: /tmp/testdata ! : ! 0 Up-to-date addtest1 ! 1 Up-to-date test1 ! dirX: ! 2 Up-to-date addtest4 ! 3 Up-to-date renamed ! testdir: ! 4 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ enter filenumber/filename to rename: enter new filename: Rename: /tmp/testdata/dirX/addtest4 => renamed2 ! Are you sure (yes|no)? cd /tmp/testdata ! cvs -d /tmp/cvsroot add renamed2 ! cd /tmp/testdata ! cd /tmp/testdata ! cvs -d /tmp/cvsroot remove /tmp/testdata/dirX/addtest4 ! cd /tmp/testdata ! ! The files have been scheduled for removal/addition. ! Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ No files given. This will commit the whole directory ! tree starting from here. Answer `yes' if you want to do ! so, `no' to abort the operation or specify some files ! to operate on. cd /tmp/testdata ! cvs -d /tmp/cvsroot commit -m 'test' ! cd /tmp/testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ cvs -d /tmp/cvsroot status 2>&1 ! Root Directory: /tmp/testdata ! : ! 0 Up-to-date addtest1 ! 1 Up-to-date renamed2 ! 2 Up-to-date test1 ! dirX: ! 3 Up-to-date renamed ! testdir: ! 4 Up-to-date test3 ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ enter new filename: Rename: /tmp/testdata/test1 => /tmp/testdata//renamed3 ! Are you sure (yes|no)? cd /tmp/testdata ! cvs -d /tmp/cvsroot add /tmp/testdata//renamed3 ! cd /tmp/testdata ! cd /tmp/testdata ! cvs -d /tmp/cvsroot remove /tmp/testdata/test1 ! cd /tmp/testdata ! ! The files have been scheduled for removal/addition. ! Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ No files given. This will commit the whole directory ! tree starting from here. Answer `yes' if you want to do ! so, `no' to abort the operation or specify some files ! to operate on. cd /tmp/testdata ! cvs -d /tmp/cvsroot commit -m 'test' ! cd /tmp/testdata ! cvs -q -d /tmp/cvsroot -n update -P ! No entries available. ! [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ Rename: renamed => ./renamed4 ! Are you sure (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ enter new filename: Rename: renamed2 => ./renamed5 ! Are you sure (yes|no)? cd . ! cvs -d /tmp/cvsroot add ./renamed5 ! cd /tmp/testdata ! cd . ! cvs -d /tmp/cvsroot remove renamed2 ! cd /tmp/testdata ! ! The files have been scheduled for removal/addition. ! Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m ! $ enter filenumber/filename to rename: enter new filename: Rename: renamed3 => renamed6 ! Are you sure (yes|no)? cd . ! cvs -d /tmp/cvsroot add renamed6 ! cd /tmp/testdata ! cd . ! cvs -d /tmp/cvsroot remove renamed3 ! cd /tmp/testdata ! ! The files have been scheduled for removal/addition. ! Should I run `commit' to remove/add the files permanently (yes|no)? [0m[36m{ar} /tmp/testdata [/tmp/cvsroot][0m $ rm -rf /tmp/testdata /tmp/cvsroot ! [0m[36m{ar} ERROR [/tmp/cvsroot][0m $ CvsShell done. Index: run-test.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/run-test.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** run-test.py 14 Mar 2002 18:45:47 -0000 1.3 --- run-test.py 27 May 2002 06:40:38 -0000 1.4 *************** *** 30,38 **** refstdout = thisDir + '/refstdout' refstderr = thisDir + '/refstderr' testcode = open(thisDir + '/testinput').read() os.system('rm -rf /tmp/testdata /tmp/cvsroot') # little clean-up try: ! os.unlink(os.path.join(os.environ['HOME'], '.cvsshellrc')) ! except: pass os.chdir('/tmp') stdin, stdout, stderr = os.popen3('python %s/../src/cvs_shell.py -v' % thisDir) --- 30,41 ---- refstdout = thisDir + '/refstdout' refstderr = thisDir + '/refstderr' + savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') testcode = open(thisDir + '/testinput').read() os.system('rm -rf /tmp/testdata /tmp/cvsroot') # little clean-up try: ! os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) ! restoreRC = 1 ! except: ! restoreRC = 0 os.chdir('/tmp') stdin, stdout, stderr = os.popen3('python %s/../src/cvs_shell.py -v' % thisDir) *************** *** 40,44 **** --- 43,49 ---- stdin.close() logstdout = tempfile.mktemp() + print 'logstdout: %s' % logstdout logstderr = tempfile.mktemp() + print 'logstderr: %s' % logstderr open(logstdout,'w').write(stdout.read()) stdout.close() *************** *** 57,63 **** a = raw_input('Should the result be saved as the new reference (yes|no)? ') if a == 'yes': ! os.rename(logstdout, refstdout) ! os.rename(logstderr, refstderr) ! os.unlink(os.path.join(os.environ['HOME'], '.cvsshellrc')) if __name__ == '__main__': --- 62,72 ---- a = raw_input('Should the result be saved as the new reference (yes|no)? ') if a == 'yes': ! os.system('mv %s %s' % (logstdout, refstdout)) ! os.system('mv %s %s' % (logstderr, refstderr)) ! if restoreRC: ! try: ! os.rename(savedRC,os.path.join(os.environ['HOME'], '.cvsshellrc')) ! except OSError: ! pass if __name__ == '__main__': Index: testinput =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testinput,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testinput 11 Mar 2002 12:02:15 -0000 1.2 --- testinput 27 May 2002 06:40:38 -0000 1.3 *************** *** 73,76 **** --- 73,77 ---- n commit -Q -m 'dummy' + yes ls echo ====== Testing remove ====== *************** *** 83,87 **** remove dirX ls ! cd rm -rf /tmp/testdata /tmp/cvsroot exit --- 84,120 ---- remove dirX ls ! echo ====== Testing rename ==== ! status ! rename 2 $OLD_DIR/renamed ! yes ! no ! commit -m 'test' ! yes ! status ! rename ! 2 ! renamed2 ! yes ! no ! commit -m 'test' ! yes ! status ! rename 2 ! $OLD_DIR/renamed3 ! yes ! no ! commit -m 'test' ! yes ! rename renamed $OLD_DIR/renamed4 ! no ! rename renamed2 ! $OLD_DIR/renamed5 ! yes ! no ! rename ! renamed3 ! renamed6 ! yes ! no rm -rf /tmp/testdata /tmp/cvsroot exit |
From: Stefan H. <ste...@us...> - 2002-05-27 06:33:28
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv2307 Modified Files: install.py Log Message: added support for migrating cvsroot aliases to new rc-file. Index: install.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/install.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** install.py 11 Mar 2002 12:02:13 -0000 1.3 --- install.py 27 May 2002 06:33:24 -0000 1.4 *************** *** 25,32 **** thisDir = os.path.join(os.getcwd(), sys.path[0]) ! sys.path.insert(1, os.path.join(thisDir, 'src')) from interactive_app import InteractiveApp ! from cvs_shell import NAME, VERSION, COPYRIGHT, BUG_ADDRESS ! class Installation(InteractiveApp): --- 25,31 ---- thisDir = os.path.join(os.getcwd(), sys.path[0]) ! sys.path.insert(0, os.path.join(thisDir, 'src')) from interactive_app import InteractiveApp ! from cvs_shell import NAME, VERSION, COPYRIGHT, BUG_ADDRESS, CvsShell class Installation(InteractiveApp): *************** *** 41,44 **** --- 40,45 ---- self.cvsDir = None self.initOptions('') + self.rcFile = os.path.join(self.HOME,'.cvsshellrc') + self.defaultRcFile = os.path.join(thisDir, 'etc', 'default-cvsshellrc') *************** *** 69,75 **** def start(self): InteractiveApp.start(self) - if self.onWindows: - pass #self.exit("Windows is currently not supported. I am working on it.") - def inPath(self, dir): --- 70,73 ---- *************** *** 83,86 **** --- 81,85 ---- self.printMsg(failureMsg) return + self.migrateRCFile() startup, content = self.createStartScript() try: *************** *** 98,101 **** --- 97,126 ---- self.printMsg('You can also click the icon of this file in the explorer.') + def migrateRCFile(self): + if os.path.exists(self.rcFile): + answ = self.prompt('The default .cvsshellrc file has changed. Should I install\n' + 'the new version? Aliases for cvsroots will be transfaired\n' + 'from the old configuration file to the new .cvsshellrc file.\n' + '(yes|no) ') + if answ == 'yes': + errorMsg = 'Could not migrate the .cvsshellrc file.' + app = CvsShell() + aliases = app.cvsRootAliases + rcFileCopy = self.rcFile + '-saved' + try: + os.rename(self.rcFile, rcFileCopy) + except OSError, msg: + self.printErr(msg) + self.printErr(errorMsg) + return + import shutil + shutil.copyfile(self.defaultRcFile,self.rcFile) + lines = [] + for a in aliases.items(): + lines.append('%s = %s' % a) + app.appendToSection('CVSROOT', lines) + + + def createStartScript(self): |
From: <no...@so...> - 2002-03-30 12:42:52
|
Feature Requests item #537083, was opened at 2002-03-30 04:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=537083&group_id=48175 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Listing out of date Initial Comment: The warning that the listing is out of date should be printed colorized. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=537083&group_id=48175 |
From: <no...@so...> - 2002-03-30 12:41:42
|
Feature Requests item #537082, was opened at 2002-03-30 04:41 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=537082&group_id=48175 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Adding directories Initial Comment: When directories are added , the files in the directories should automatically be included in the listing ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=537082&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-03-28 23:07:40
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv26979/src Modified Files: interactive_app.py Log Message: added support for default value in prompt Index: interactive_app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/interactive_app.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** interactive_app.py 11 Mar 2002 10:09:50 -0000 1.6 --- interactive_app.py 28 Mar 2002 23:07:37 -0000 1.7 *************** *** 20,24 **** ############################################################################### ! import os from app import App, AppError --- 20,24 ---- ############################################################################### ! import os, types from app import App, AppError *************** *** 28,31 **** --- 28,32 ---- App.__init__(self) self.BREAK_REPL = 'BREAK_REPL' + self.DEF_PATTERN = '%%def%%' try: import readline *************** *** 60,71 **** def readCommand(self): # subclass hooks + App.start,stop ! return self.prompt(self.getPrompt()) def getPrompt(self): return '? ' ! def prompt(self, msg): """Displayes msg and prompts the user for input. ! If input is EOF, None is returned.""" try: a = raw_input(msg) --- 61,86 ---- def readCommand(self): # subclass hooks + App.start,stop ! p = self.getPrompt() ! if type(p) == types.TupleType: ! return self.prompt(p[0], p[1]) ! else: ! return self.prompt(p) def getPrompt(self): return '? ' ! def prompt(self, msg, default=None): """Displayes msg and prompts the user for input. ! If input is EOF, None is returned. ! If input is the emtpy string and default is given, default is returned. ! If a default value is given and msg contains self.DEF_PATTERN, ! this part of msg is replaced by the default value surrounded with []. ! Otherwise the default value is append at the end of msg.""" ! if default is not None: ! i = msg.find(self.DEF_PATTERN) ! if i >= 0: ! msg = msg[:i] + '[' + default + ']'+ msg[i+len(self.DEF_PATTERN):] ! else: ! msg += '[%s] ' % default try: a = raw_input(msg) *************** *** 78,82 **** a = os.path.expandvars(a) a = os.path.expanduser(a) ! return a.strip() def evalCommand(self, command): --- 93,99 ---- a = os.path.expandvars(a) a = os.path.expanduser(a) ! a = a.strip() ! if a == '' and default is not None: return default ! else: return a def evalCommand(self, command): |
From: Stefan H. <ste...@us...> - 2002-03-28 23:07:40
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv26979 Modified Files: ChangeLog Log Message: added support for default value in prompt Index: ChangeLog =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 28 Mar 2002 21:39:11 -0000 1.2 --- ChangeLog 28 Mar 2002 23:07:37 -0000 1.3 *************** *** 11,12 **** --- 11,15 ---- - etc/default-cvsshellrc: changed color settings + + API Additions: + + - src/interactive_app.py: prompt supports default value for answer |
From: Stefan H. <ste...@us...> - 2002-03-28 21:39:16
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv2038 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLog 28 Mar 2002 21:11:03 -0000 1.1 --- ChangeLog 28 Mar 2002 21:39:11 -0000 1.2 *************** *** 1,4 **** ! 2002-03-28 Stefan Heimann <ma...@st...> ! * etc/default-cvsshellrc: changed color settings --- 1,12 ---- ! CvsShell Version History ! * Version 0.2 ! ! + New Features: ! ! + Bugfixes: ! ! + Enhancements: ! ! - etc/default-cvsshellrc: changed color settings |
From: Stefan H. <ste...@us...> - 2002-03-28 21:39:16
|
Update of /cvsroot/cvsshell/cvsshell/etc In directory usw-pr-cvs1:/tmp/cvs-serv2038/etc Modified Files: default-cvsshellrc Log Message: Index: default-cvsshellrc =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/etc/default-cvsshellrc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** default-cvsshellrc 15 Mar 2002 10:43:37 -0000 1.8 --- default-cvsshellrc 28 Mar 2002 21:39:11 -0000 1.9 *************** *** 16,24 **** # color-new = color-added = purple ! color-conflict = red color-modified = green ! color-patched = yellow # color-removed = ! color-updated = blue color-unknown = pink # color-ok --- 16,24 ---- # color-new = color-added = purple ! color-conflict = yellow color-modified = green ! color-patched = red # color-removed = ! color-updated = lblue color-unknown = pink # color-ok *************** *** 39,43 **** # needed by these commands. section DEFAULT_CMD_OPTIONS: - ALL = -z 3 up, upd, update = -q -P end --- 39,42 ---- |
From: Stefan H. <ste...@us...> - 2002-03-28 21:11:11
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv24921 Added Files: ChangeLog Log Message: initial checkin --- NEW FILE: ChangeLog --- 2002-03-28 Stefan Heimann <ma...@st...> * etc/default-cvsshellrc: changed color settings |
From: <no...@so...> - 2002-03-19 15:09:30
|
Feature Requests item #531887, was opened at 2002-03-19 07:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531887&group_id=48175 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Rename command Initial Comment: It should be possible to rename a file. 1.) mv old new 2.) cvs remove old 3.) cvs add new 4.) commit new ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531887&group_id=48175 |
From: <no...@so...> - 2002-03-19 07:35:08
|
Feature Requests item #531777, was opened at 2002-03-19 08:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531777&group_id=48175 Category: None Group: None Status: Open Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: Automatic refresh Initial Comment: It should be possible to configure a automatic refresh of the listing (if marked dirty) and a automatic redrawing of the listing. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531777&group_id=48175 |
From: <no...@so...> - 2002-03-19 07:34:05
|
Feature Requests item #531774, was opened at 2002-03-19 08:34 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531774&group_id=48175 Category: None Group: None Status: Open Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: Better aliases Initial Comment: Aliases should not only store the CVSROOT but also the local directory to checkout the module and the module itself. Suggested syntax start BOOKMARKS: key = localdir, cvsroot, module end module must not be given. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=452215&aid=531774&group_id=48175 |
From: Stefan H. <ste...@us...> - 2002-03-16 13:30:53
|
Update of /cvsroot/cvsshell/cvsshell In directory usw-pr-cvs1:/tmp/cvs-serv12002 Modified Files: index.html Log Message: Index: index.html =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 15 Mar 2002 20:22:39 -0000 1.2 --- index.html 16 Mar 2002 13:30:50 -0000 1.3 *************** *** 10,13 **** --- 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.1 (2002-03-16). </p> *************** *** 30,34 **** <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Fri Mar 15 21:09:47 CET 2002 <!-- hhmts end --> <br> --- 31,35 ---- <!-- Created: Fri Mar 15 20:53:58 CET 2002 --> <!-- hhmts start --> ! Last modified: Sat Mar 16 14:30:05 CET 2002 <!-- hhmts end --> <br> |
From: Stefan H. <ste...@us...> - 2002-03-16 13:26:40
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv11151/src Modified Files: app.py Log Message: * fixed some typos Index: app.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/app.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** app.py 15 Mar 2002 10:37:53 -0000 1.11 --- app.py 16 Mar 2002 13:26:37 -0000 1.12 *************** *** 31,35 **** def __init__(self): - # the directory this file is placed in GetSetProvider.__init__(self) self.onWindows = sys.platform[:3] == 'win' --- 31,34 ---- |