Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d4ee8b

Browse files
committed
major update
1 parent 097c55a commit 4d4ee8b

1 file changed

Lines changed: 8 additions & 28 deletions

File tree

Demo/pdist/rrcs.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
#! /usr/local/bin/python
22

3+
"Remote RCS -- command line interface"
4+
35
import sys
46
import os
57
import getopt
68
import string
79
import md5
810
import tempfile
11+
from rcsclient import openrcsclient
912

1013
def 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-
6747
def checkin(x, copts, fn):
6848
f = open(fn)
6949
data = f.read()

0 commit comments

Comments
 (0)