Update of /cvsroot/cvsshell/cvsshell/src
In directory sc8-pr-cvs1:/tmp/cvs-serv22538/src
Modified Files:
cvs_cmds.py cvs_shell.py
Log Message:
implemented diff command
Index: cvs_cmds.py
===================================================================
RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** cvs_cmds.py 19 Apr 2003 18:19:10 -0000 1.20
--- cvs_cmds.py 20 Apr 2003 20:52:04 -0000 1.21
***************
*** 675,681 ****
Prompts you for all arguments needed.
"""
! print 'Not yet implemented'
! # try:
! # (globOpts, opts,
! # myOpts, rest) = app.parseArgs(args,
! # app.getCmdToAllowedOpts().get(name, ''))
--- 675,727 ----
Prompts you for all arguments needed.
"""
! try:
! (globOpts, opts,
! myOpts, rest) = app.parseArgs(args,
! app.getCmdToAllowedOpts().get(name, ''))
! except getopt.GetoptError, msg:
! app.printErr(msg)
! return
! rest = rest.split()
! rev1 = ''
! rev2 = ''
! fileOrId = ''
! n = len(rest)
! if n == 0:
! rev1 = app.prompt('Revision 1 of the file (leave blank if you want to compare the '\
! 'working\ndirectory version with the latest revision in the repository): ')
! if rev1 is None: return
! elif rev1 != '':
! rev2 = app.prompt('Revision 2 of the file (leave blank if you want to compare the '\
! 'working\ndirectory version with revision 1): ')
! if rev2 is None: return
! if rev1: rev1 = '-r ' + rev1
! if rev2: rev2 = ' -r ' + rev2
! fileOrId = app.prompt('Filename(s) or ID(s): ')
! if fileOrId is None: return
! elif n == 1:
! fileOrId = rest[0]
! elif n == 2:
! if os.path.exists(rest[0]):
! fileOrId = rest[0] + ' ' + rest[1]
! else:
! rev1 = '-r ' + rest[0]
! fileOrId = rest[1]
! else:
! if os.path.exists(rest[0]):
! fileOrId = ' '.join(rest)
! elif os.path.exists(rest[1]):
! rev1 = '-r ' + rest[0]
! fileOrId = ' '.join(rest[1:])
! else:
! rev1 = '-r ' + rest[0]
! rev2 = ' -r ' + rest[1]
! fileOrId = ' '.join(rest[2:])
! try:
! filenames = ' '.join(app.applyOnEntryList(fileOrId, lambda e, fname: fname))
! except utils.ParseError: # args do not spefiy ids in the current listing
! filenames = fileOrId
! args = opts + ' ' + rev1 + rev2 + ' ' + filenames
! try:
! app.more(app.runCvsCmd('diff', globOpts=globOpts, args=args))
! except CvsError:
! return
Index: cvs_shell.py
===================================================================
RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_shell.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** cvs_shell.py 19 Apr 2003 18:20:27 -0000 1.41
--- cvs_shell.py 20 Apr 2003 20:52:05 -0000 1.42
***************
*** 292,295 ****
--- 292,298 ----
override the default global options
* args are the arguments that should be passed to the cvs command
+ * fork: if fork == 1, a the output of the command is read and returned
+ to the caller, otherwise the command is executed using os.system.
+ Note: the name of the parameter is not well choosen.
"""
***************
*** 320,332 ****
lines = f.readlines()
except KeyboardInterrupt:
! raise CvsError
! if f.close() is not None: # cvs command caused an error
! raise CvsError
! else:
! return lines
else:
r = os.system(cmd)
if r != 0:
! raise CvsError
if oldDir is not None:
try:
--- 323,333 ----
lines = f.readlines()
except KeyboardInterrupt:
! raise CvsError, "Keyboard interrupt"
! f.close()
! return lines
else:
r = os.system(cmd)
if r != 0:
! raise CvsError, "exit code != 0"
if oldDir is not None:
try:
|