11#! /usr/local/bin/python
22
3+ "Remote RCS -- command line interface"
4+
35import sys
46import os
57import getopt
68import string
79import md5
810import tempfile
11+ from rcsclient import openrcsclient
912
1013def main ():
1114 sys .stdout = sys .stderr
1215 try :
13- opts , rest = getopt .getopt (sys .argv [1 :], 'h:p:qv' )
16+ opts , rest = getopt .getopt (sys .argv [1 :], 'h:p:d: qv' )
1417 if not rest :
15- raise getopt .error , "missing command"
16- cmd , rest = rest [0 ], rest [1 :]
18+ cmd = 'head'
19+ else :
20+ cmd , rest = rest [0 ], rest [1 :]
1721 if not commands .has_key (cmd ):
1822 raise getopt .error , "unknown command"
1923 coptset , func = commands [cmd ]
@@ -31,7 +35,7 @@ def main():
3135 print " diff # diff rcs file and work file"
3236 print "if no files are given, all remote rcs files are assumed"
3337 sys .exit (2 )
34- x = openclient (opts )
38+ x = openrcsclient (opts )
3539 if not files :
3640 files = x .listfiles ()
3741 for fn in files :
@@ -40,30 +44,6 @@ def main():
4044 except (IOError , os .error ), msg :
4145 print "%s: %s" % (fn , msg )
4246
43- def openclient (opts ):
44- import client
45- import RCSProxy
46- host = 'spam'
47- port = 4127
48- verbose = client .VERBOSE
49- for o , a in opts :
50- if o == '-h' :
51- host = a
52- if ':' in host :
53- i = string .find (host , ':' )
54- host , p = host [:i ], host [i + 1 :]
55- if p :
56- port = string .atoi (p )
57- if o == '-p' :
58- port = string .atoi (a )
59- if o == '-v' :
60- verbose = verbose + 1
61- if o == '-q' :
62- verbose = 0
63- address = (host , port )
64- x = RCSProxy .RCSProxyClient (address , verbose )
65- return x
66-
6747def checkin (x , copts , fn ):
6848 f = open (fn )
6949 data = f .read ()
0 commit comments