Folks,
It turns out that , for files which were completely removed from the CVS
repository (from both repository and Attic/), there's no any history
information to re-create their contents. -- But you still see the
changes referring to them in the committed sets.
The end result is that cvs update <some file> command might run and
not create a file, and also not report an error about it.
This creates problems, since tailor expects all fetched files to be
present.
Attached is an experimental patch that checks if all updated files were
actually created. For files that were not, we create an empty file as
a placeholder and produce appropriate warning message. This allows
the import process to continue properly.
Regards,
-doc
--- /mnt/tailor/vcpx/repository/cvsps.py 2007-07-09 15:58:39.000000000 +0200
+++ vcpx/repository/cvsps.py 2007-07-10 18:38:08.000000000 +0200
@@ -276,8 +276,8 @@
return False
def _applyChangeset(self, changeset):
- from os.path import join, exists, split
- from os import listdir
+ from os.path import join, exists, split, dirname, isdir
+ from os import listdir, makedirs
from shutil import rmtree
from time import sleep
from vcpx.repository.cvs import CvsEntries, compare_cvs_revs
@@ -371,6 +371,24 @@
"%s returned status %s" % (str(cvsup),
cvsup.exit_status))
+ # When a file is added to CVS and later completely removed
+ # (including the history in Attic/), CVS loses *all* information
+ # about it. So when you do 'cvs update <one-such-file>', CVS might
+ # actually not do anything (but it still exits with success status).
+ # This causes problems because we want to operate on files that
+ # might not exist in our repository. Therefore we need to manually
+ # find files which did not get created, and create them ourselves
+ # to prevent subsequent commands from failing.
+ for name in names:
+ path = self.repository.basedir + '/' + name
+ if not exists(path):
+ dirnm = dirname(path)
+ if dirnm and not isdir(dirnm):
+ makedirs(dirnm)
+ touchfile = open(path, "w")
+ touchfile.close
+ self.log.warning("creating empty file %s, CVS no longer contains data to reconstruct its history", path)
+
self.log.debug("%s updated to %s", ','.join(names), e.new_revision)
# Fake up ADD and DEL events for the directories implicitly
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor