def main(): sys.stdout = sys.stderr try: opts, rest = getopt.getopt(sys.argv[1:], 'h:p:d:qvL') if not rest: cmd = 'head' else: cmd, rest = rest[0], rest[1:] if cmd not in commands: raise getopt.error("unknown command") coptset, func = commands[cmd] copts, files = getopt.getopt(rest, coptset) except getopt.error as msg: print(msg) print("usage: rrcs [options] command [options] [file] ...") print("where command can be:") print(" ci|put # checkin the given files") print(" co|get # checkout") print(" info # print header info") print(" head # print revision of head branch") print(" list # list filename if valid") print(" log # print full log") print(" diff # diff rcs file and work file") print("if no files are given, all remote rcs files are assumed") sys.exit(2) x = openrcsclient(opts) if not files: files = x.listfiles() for fn in files: try: func(x, copts, fn) except (IOError, os.error) as msg: print("%s: %s" % (fn, msg))
def test(): x = CVS() x.getentries() x.getlocalfiles() ## x.report() import rcsclient proxy = rcsclient.openrcsclient() x.getremotefiles(proxy) x.report()
coptset, func = commands[cmd] copts, files = getopt.getopt(rest, coptset) except getopt.error, msg: print msg print "usage: rrcs [options] command [options] [file] ..." print "where command can be:" print " ci|put # checkin the given files" print " co|get # checkout" print " info # print header info" print " head # print revision of head branch" print " list # list filename if valid" print " log # print full log" print " diff # diff rcs file and work file" print "if no files are given, all remote rcs files are assumed" sys.exit(2) x = openrcsclient(opts) if not files: files = x.listfiles() for fn in files: try: func(x, copts, fn) except (IOError, os.error), msg: print "%s: %s" % (fn, msg) def checkin(x, copts, fn): f = open(fn) data = f.read() f.close() new = not x.isvalid(fn) if not new and same(x, copts, fn, data): print "%s: unchanged since last checkin" % fn
def ready(self): import rcsclient self.proxy = rcsclient.openrcsclient(self.opts) self.cvs.setproxy(self.proxy) self.cvs.getentries()
#! /usr/bin/env python
#! /usr/bin/env python "Remote RCS -- command line interface" import sys import os import getopt import string import md5 import tempfile from rcsclient import openrcsclient def main(): sys.stdout = sys.stderr try: opts, rest = getopt.getopt(sys.argv[1:], 'h:p:d:qvL') if not rest: cmd = 'head' else: cmd, rest = rest[0], rest[1:] if not commands.has_key(cmd): raise getopt.error, "unknown command" coptset, func = commands[cmd] copts, files = getopt.getopt(rest, coptset) except getopt.error, msg: print msg print "usage: rrcs [options] command [options] [file] ..." print "where command can be:" print " ci|put # checkin the given files" print " co|get # checkout" print " info # print header info" print " head # print revision of head branch" print " list # list filename if valid"
coptset, func = commands[cmd] copts, files = getopt.getopt(rest, coptset) except getopt.error, msg: print msg print "usage: rrcs [options] command [options] [file] ..." print "where command can be:" print " ci|put # checkin the given files" print " co|get # checkout" print " info # print header info" print " head # print revision of head branch" print " list # list filename if valid" print " log # print full log" print " diff # diff rcs file and work file" print "if no files are given, all remote rcs files are assumed" sys.exit(2) x = openrcsclient(opts) if not files: files = x.listfiles() for fn in files: try: func(x, copts, fn) except (IOError, os.error), msg: print "%s: %s" % (fn, msg) def checkin(x, copts, fn): f = open(fn) data = f.read() f.close() new = not x.isvalid(fn) if not new and same(x, copts, fn, data):
"""Utilities for CVS administration."""