[Cvsshell-devel] CVS: cvsshell/src basic_cmds.py,1.27,1.28 cvs_cmds.py,1.21,1.22 cvs_shell.py,1.43,1
Status: Beta
Brought to you by:
stefanheimann
From: Stefan H. <ste...@us...> - 2003-04-20 21:35:30
|
Update of /cvsroot/cvsshell/cvsshell/src In directory sc8-pr-cvs1:/tmp/cvs-serv2864/src Modified Files: basic_cmds.py cvs_cmds.py cvs_shell.py Log Message: * updated documentation Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** basic_cmds.py 20 Apr 2003 20:52:38 -0000 1.27 --- basic_cmds.py 20 Apr 2003 21:35:26 -0000 1.28 *************** *** 30,35 **** def cmdHelp(app, name, opts): """Print this help message. ! If the name of a command is given, a detailed help for this command ! is printed.""" so = string.split(opts) if len(so) > 0: --- 30,37 ---- def cmdHelp(app, name, opts): """Print this help message. ! ! If the name of a command is given, a detailed help for this command is ! printed. ! """ so = string.split(opts) if len(so) > 0: *************** *** 37,41 **** cmd = so[0] doc = app.cmdToDoc[cmd] ! help = doc app.more(help) return --- 39,43 ---- cmd = so[0] doc = app.cmdToDoc[cmd] ! help = doc.strip() + '\n' app.more(help) return *************** *** 59,66 **** help += "%s%s %s\n" % (name,space,doc) help += """ ! All commands not listed here are passed to the underlying shell. ! You can also use IDs from the current listing as arguments to these commands. ! If the IDs should be embedded into other command options, you can enclose ! them with `[[' and `]]'. Example: --- 61,68 ---- help += "%s%s %s\n" % (name,space,doc) help += """ ! All commands not listed here are passed to the underlying shell. You ! can also use IDs from the current listing as arguments to these ! commands. If the IDs should be embedded into other command options, ! you can enclose them with `[[' and `]]'. Example: *************** *** 71,76 **** `help list'. ! You can get more help for a specific command by typing ! `help <name-of-command>'.""" app.more(help) --- 73,79 ---- `help list'. ! You can get more help for a specific command by typing `help ! <name-of-command>'. ! """ app.more(help) *************** *** 115,121 **** 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 that changed some information on the CVS server but not ! in the local listing.""" app.autoRefresh = app.toggle(app.autoRefresh, args) --- 118,126 ---- 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 that changed some information on the CVS server but not in the ! local listing. ! """ app.autoRefresh = app.toggle(app.autoRefresh, args) *************** *** 123,128 **** 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) --- 128,135 ---- 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) *************** *** 134,147 **** """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. Note: The 'refresh' command works only on local files. This means that changes committed to the respository after the last synchronization of ! your local working copy are not seen in the listing produced by 'refresh'. ! The abbreviation `rd' means `repository date', `wd' means `working date'.""" from time import strftime, localtime def isCvsInfoDir(path): --- 141,157 ---- """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. Note: The 'refresh' command works only on local files. This means that changes committed to the respository after the last synchronization of ! your local working copy are not seen in the listing produced by ! 'refresh'. ! The abbreviation `rd' means `repository date', `wd' means `working ! date'. ! """ from time import strftime, localtime def isCvsInfoDir(path): Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** cvs_cmds.py 20 Apr 2003 20:52:04 -0000 1.21 --- cvs_cmds.py 20 Apr 2003 21:35:27 -0000 1.22 *************** *** 31,40 **** def status(app, name, args): """Display status information on checked out files. ! 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 ! `filter' in the CONFIG section of ~/.cvsshellrc.""" import stat from time import gmtime,strftime --- 31,43 ---- def status(app, name, args): """Display status information on checked out files. ! ! This command creates a listing with all checked out files and their ! status. The abbreviation `rr' stands for `repository revision', `wr' ! means `working revision'. ! If you want to display the status only for certain files, you can ! specify these files as arguments to the `status' command (either via ! filenames of ids in the listing). ! """ import stat from time import gmtime,strftime *************** *** 51,59 **** app.printErr(msg) return ! try: ! l = app.applyOnEntryList(rest, lambda e, name: (e, name)) ! rest = ' '.join(map(lambda t: t[1], l)) ! # args do not spefiy ids in the current listing ! except utils.ParseError: pass try: lines = app.runCvsCmd('status', globOpts=globOpts, args=opts+' '+rest, getStderr=1) --- 54,63 ---- app.printErr(msg) return ! if rest: ! try: ! l = app.applyOnEntryList(rest, lambda e, name: (e, name)) ! rest = ' '.join(map(lambda t: t[1], l)) ! # args do not spefiy ids in the current listing ! except utils.ParseError: pass try: lines = app.runCvsCmd('status', globOpts=globOpts, args=opts+' '+rest, getStderr=1) *************** *** 103,111 **** def update(app, name, args, simulate=0): """Bring work tree in sync with repository. This command donwloads new files and changes to already checked out files from the server. It also brings the ! listing in sync with the repository.""" try: (globOpts, opts, --- 107,163 ---- + _updateStatusCodes = ['U', 'P', 'A', 'R', 'M', 'C', '?'] + def update(app, name, args, simulate=0): """Bring work tree in sync with repository. + This command donwloads new files and changes to already checked out files from the server. It also brings the ! listing in sync with the repository. ! ! If you want to update only some files, you can specify these files as ! arguments to the `update' command (either via filenames of ids in the ! listing). ! ! For every file a letter denoting its status is displayed (the ! description are taken from the CVS manual, see ! http://www.cvshome.org/docs/manual/): ! ! U: The file was brought up to date with respect to the repository. ! This is done for any file that exists in the repository but not in ! your source, and for files that you haven't changed but are not the ! most recent versions available in the repository. ! ! P: Like `U', but the CVS server sends a patch instead of an entire ! file. This accomplishes the same thing as `U' using less bandwidth. ! ! A: The file has been added to your private copy of the sources, and ! will be added to the source repository when you run commit on the ! file. This is a reminder to you that the file needs to be ! committed. ! ! R: The file has been removed from your private copy of the sources, ! and will be removed from the source repository when you run commit ! on the file. This is a reminder to you that the file needs to be ! committed. ! ! M: The file is modified in your working directory. `M' can indicate ! one of two states for a file you're working on: either there were ! no modifications to the same file in the repository, so that your ! file remains as you last saw it; or there were modifications in the ! repository as well as in your copy, but they were merged ! successfully, without conflict, in your working directory. ! ! C: A conflict was detected while trying to merge your changes to file ! with changes from the source repository. The copy in your working ! directory is now the result of attempting to merge the two ! revisions; an unmodified copy of your file is also in your working ! directory, with the name `.#file.revision' where revision is the ! revision that your modified file started from. ! ! ?: The file is in your working directory, but does not correspond to ! anything in the source repository, and is not in the list of files ! for CVS to ignore. ! """ try: (globOpts, opts, *************** *** 133,136 **** --- 185,189 ---- if len(x) < 2 or x[0] == 'cvs': continue status = x[0] + if status not in _updateStatusCodes: continue name = os.path.basename(x[1]) dir = os.path.dirname(x[1]) *************** *** 156,161 **** def simulateUpdate(app, name, args): """Refresh the current listing by simulating an update. ! This command runs update without really downloading the ! changes. See `help update' for details.""" update(app, name, args, simulate=1) --- 209,216 ---- def simulateUpdate(app, name, args): """Refresh the current listing by simulating an update. ! ! This command runs update without really downloading the changes. See ! `help update' for details. ! """ update(app, name, args, simulate=1) *************** *** 163,173 **** def checkout(app, name, args): """Checkout sources for editing. ! This command checks out sources from the repository into the ! current working directory. It takes two arguments: ! * the cvsroot to use. This option is ignored and must not be given ! if the cvsroot is already set. * the module to checkout. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, --- 218,232 ---- def checkout(app, name, args): """Checkout sources for editing. ! ! This command checks out sources from the repository into the current ! working directory. It takes two arguments: ! ! * the cvsroot to use. This option is ignored and must not be given if ! the cvsroot is already set. * the module to checkout. ! ! You can invoke the command without any arguments as it prompts you if ! needed. ! """ try: (globOpts, opts, *************** *** 206,216 **** def add(app, name, args, isBinary=0): """Add a new file/directory to the repository. This command accepts two kind of arguments which cannot be intermixed: * list of files/directories. * an ID-string More information on the format of the ID-string is available by typing `help list'. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, --- 265,280 ---- def add(app, name, args, isBinary=0): """Add a new file/directory to the repository. + This command accepts two kind of arguments which cannot be intermixed: + * list of files/directories. * an ID-string + More information on the format of the ID-string is available by typing `help list'. ! ! You can invoke the command without any arguments as it prompts you if ! needed. ! """ try: (globOpts, opts, *************** *** 276,280 **** def addBinary(app, name, args): """Add a new binary file to the repository. ! See the help section of the add command for more information.""" app.printMsg('The file will be added in binary mode.') add(app, name, args, isBinary=1) --- 340,346 ---- def addBinary(app, name, args): """Add a new binary file to the repository. ! ! See the help section of the add command for more information. ! """ app.printMsg('The file will be added in binary mode.') add(app, name, args, isBinary=1) *************** *** 283,293 **** def commit(app, name, args): """Check files into the repository. ! This command accepts three kind of arguments which cannot be intermixed: * list of files/directories. * an ID-string ! * an empty argument list: All modified file in the current directory and all ! it's subdirectories are commited. More information on the format of the ID-string is available by typing ! `help list'.""" try: (globOpts, opts, --- 349,364 ---- def commit(app, name, args): """Check files into the repository. ! ! This command accepts three kind of arguments which cannot be ! intermixed: ! * list of files/directories. * an ID-string ! * an empty argument list: All modified file in the current directory ! and all it's subdirectories are commited. ! More information on the format of the ID-string is available by typing ! `help list'. ! """ try: (globOpts, opts, *************** *** 343,353 **** def remove(app, name, args): """Remove an entry (some entries) from the repository. This command accepts two kind of arguments which cannot be intermixed: * list of files/directories. * an ID-string More information on the format of the ID-string is available by typing `help list'. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, --- 414,429 ---- def remove(app, name, args): """Remove an entry (some entries) from the repository. + This command accepts two kind of arguments which cannot be intermixed: + * list of files/directories. * an ID-string + More information on the format of the ID-string is available by typing `help list'. ! ! You can invoke the command without any arguments as it prompts you if ! needed. ! """ try: (globOpts, opts, *************** *** 419,429 **** 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: ' --- 495,508 ---- 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: ' *************** *** 502,516 **** def printListing(app, name, args): """Print out the current listing. The numbers on the left side of the listing are the IDs of the files. ! Many commands accept an ID-string, that is string that specifies some IDs. ! These IDs are replaced by the corresponding filenames. The ID-string must have the following format: #, #, #, ... , # - where # is either !% or % - where % is either a digit or a range of digits (written k-n if k,n are digits) ! All numbers given with % are added to the list of ids, ! all numbers given with !% are removed from this list. ! The ID-string is evaluated from left to right. Example: --- 581,598 ---- def printListing(app, name, args): """Print out the current listing. + The numbers on the left side of the listing are the IDs of the files. ! Many commands accept an ID-string, that is string that specifies some ! IDs. These IDs are replaced by the corresponding filenames. The ID-string must have the following format: #, #, #, ... , # + - where # is either !% or % - where % is either a digit or a range of digits (written k-n if k,n are digits) ! ! All numbers given with % are added to the list of ids, all numbers ! given with !% are removed from this list. The ID-string is evaluated ! from left to right. Example: *************** *** 518,527 **** selects the files with the ids 3, 4, 7, 9, 10, 12, 19 ! The listing can be filtered by setting the variable ! `filter' in the CONFIG section of ~/.cvsshellrc. If the listing ! was produced by a cvs command like ``update'', the CVS filtering rules ! apply. If the listing was produced by a non-CVS command (for example ! with the builtin ``refresh'' command), only the filters in $CVSIGNORE, ! ~/.cvsignore and ./.cvsignore are considered.""" app.printListing() --- 600,610 ---- selects the files with the ids 3, 4, 7, 9, 10, 12, 19 ! The listing can be filtered by setting the variable `filter' in the ! CONFIG section of ~/.cvsshellrc. If the listing was produced by a cvs ! command like ``update'', the CVS filtering rules apply. If the listing ! was produced by a non-CVS command (for example with the builtin ! ``refresh'' command), only the filters in $CVSIGNORE, ~/.cvsignore and ! ./.cvsignore are considered. ! """ app.printListing() *************** *** 569,575 **** def toggleCvsRootAutoUpdate(app, name, args): """Toggle the auto-update feature for the CVSROOT var. ! If this option is set, the CVSROOT variable is automatically updated when a new ! directory is entered. Without a argument the option is toggled. You can set the ! option to a new value with `on' or `off' as argument.""" app.cvsRootAutoUpdate = app.toggle(app.cvsRootAutoUpdate, args) if app.cvsRootAutoUpdate: --- 652,661 ---- def toggleCvsRootAutoUpdate(app, name, args): """Toggle the auto-update feature for the CVSROOT var. ! ! If this option is set, the CVSROOT variable is automatically updated ! when a new directory is entered. Without a argument the option is ! toggled. You can set the option to a new value with `on' or `off' as ! argument. ! """ app.cvsRootAutoUpdate = app.toggle(app.cvsRootAutoUpdate, args) if app.cvsRootAutoUpdate: *************** *** 580,587 **** """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, --- 666,674 ---- """Replaces a file with a given revision. ! This command takes two arguments: ! * the revision to replace the file with ! * the file to replace ! """ try: (globOpts, opts, *************** *** 624,629 **** def login(app, name, args): """Log in to a remote repository. Normally, it's not necessary to use this command explicitely because ! cvsshell logs in automatically when needed.""" try: (globOpts, opts, --- 711,718 ---- def login(app, name, args): """Log in to a remote repository. + Normally, it's not necessary to use this command explicitely because ! cvsshell logs in automatically when needed. ! """ try: (globOpts, opts, Index: cvs_shell.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** cvs_shell.py 20 Apr 2003 20:54:38 -0000 1.43 --- cvs_shell.py 20 Apr 2003 21:35:27 -0000 1.44 *************** *** 257,268 **** ! def more(self, lines=None, s=None, numlines=22): ! if lines is not None: s = string.join(lines, '') - elif s is not None: - lines = s.split('\n') else: ! 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) --- 257,267 ---- ! def more(self, lines, numlines=22): ! from types import ListType ! if type(lines) == ListType: s = string.join(lines, '') else: ! s = lines ! lines = s.split('\n') if len(lines) <= numlines or not self.configMap.has_key('pager') or self.batchMode: self.printMsg(s, nonl=1) |