summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/rcvs.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-04-28 15:26:37 (GMT)
committerGuido van Rossum <guido@python.org>1995-04-28 15:26:37 (GMT)
commit6bb4a51daacef23a08dc0e4df60f1c48d778041a (patch)
tree62c6f222d689c1f867549895a05ff44f3c95815a /Demo/pdist/rcvs.py
parentb07d729c2d3b72d26801048c2a0f4caecd7b9f66 (diff)
downloadcpython-6bb4a51daacef23a08dc0e4df60f1c48d778041a.zip
cpython-6bb4a51daacef23a08dc0e4df60f1c48d778041a.tar.gz
cpython-6bb4a51daacef23a08dc0e4df60f1c48d778041a.tar.bz2
implemented action() now, plus some bug fixes
Diffstat (limited to 'Demo/pdist/rcvs.py')
-rwxr-xr-xDemo/pdist/rcvs.py58
1 files changed, 53 insertions, 5 deletions
diff --git a/Demo/pdist/rcvs.py b/Demo/pdist/rcvs.py
index fe8651c..5b7ace8 100755
--- a/Demo/pdist/rcvs.py
+++ b/Demo/pdist/rcvs.py
@@ -23,14 +23,59 @@ class MyFile(File):
'A' -- new locally
'R' -- deleted locally
'U' -- changed remotely, no changes locally
+ (includes new remotely or deleted remotely)
'M' -- changed locally, no changes remotely
'C' -- conflict: changed locally as well as remotely
(includes cases where the file has been added
or removed locally and remotely)
+ 'r' -- get rid of entry
+ 'c' -- create entry
+ 'u' -- update entry
"""
if not self.eseen:
- pass
- return '?'
+ if not self.lseen:
+ if not self.rseen: return '0' # Never heard of
+ else:
+ return 'N' # New remotely
+ else: # self.lseen
+ if not self.rseen: return '?' # Local only
+ # Local and remote, but no entry
+ if self.lsum == self.rsum:
+ return 'c' # Restore entry only
+ else: return 'C' # Real conflict
+ else: # self.eseen
+ if not self.lseen:
+ if self.eremoved:
+ if self.rseen: return 'R' # Removed
+ else: return 'r' # Get rid of entry
+ else: # not self.eremoved
+ if self.rseen:
+ print "warning:",
+ print self.file,
+ print "was lost"
+ return 'U'
+ else: return 'r' # Get rid of entry
+ else: # self.lseen
+ if not self.rseen:
+ if self.enew: return 'A' # New locally
+ else: return 'D' # Deleted remotely
+ else: # self.rseen
+ if self.enew:
+ if self.lsum == self.rsum:
+ return 'u'
+ else:
+ return 'C'
+ if self.lsum == self.esum:
+ if self.esum == self.rsum:
+ return '='
+ else:
+ return 'U'
+ elif self.esum == self.rsum:
+ return 'M'
+ elif self.lsum == self.rsum:
+ return 'u'
+ else:
+ return 'C'
def update(self):
code = self.action()
@@ -127,7 +172,8 @@ class rcvs(CommandFrameWork):
files = []
if self.cvs.checkfiles(files):
return 1
- self.cvs.report()
+ for file in files:
+ print self.cvs.entries[file].action(), file
def do_update(self, opts, files):
"""update [file] ..."""
@@ -138,6 +184,7 @@ class rcvs(CommandFrameWork):
print "%s: not found" % file
else:
self.cvs.entries[file].update()
+ self.cvs.putentries()
def do_commit(self, opts, files):
"""commit [file] ..."""
@@ -145,13 +192,14 @@ class rcvs(CommandFrameWork):
return 1
sts = 0
for file in files:
- if not self.entries[file].commitcheck():
+ if not self.cvs.entries[file].commitcheck():
sts = 1
if sts:
return sts
message = raw_input("One-liner: ")
for file in files:
- self.entries[file].commit(message)
+ self.cvs.entries[file].commit(message)
+ self.cvs.putentries()
def main():