Index: ChangeLog
from Akim Demaille <akim(a)epita.fr>
* prcs2svn/prcs2svn.py (prcs_checkout): New.
Use it.
2004-09-22 Akim Demaille <akim(a)epita.fr>
Index: prcs2svn/prcs2svn.py
--- prcs2svn/prcs2svn.py (revision 108)
+++ prcs2svn/prcs2svn.py (working copy)
@@ -193,6 +193,13 @@
shutil.move(src, dst)
+def prcs_checkout (arg):
+ xsystem ("prcs checkout -f " + arg)
+ # PRCS sometimes lacks a \n after the messages emitted by checkout -f.
+ if 2 <= infos.trace_level:
+ print
+
+
## -------------------------------------
## Informations
@@ -419,10 +426,7 @@
prcs_revision = " -r " + prcs_revision + " "
xmkdir (self.prcs_project + "_prcs")
xchdir (self.prcs_project + "_prcs")
- xsystem("prcs checkout -f " + prcs_revision + self.prjname ())
- # PRCS sometimes lacks a \n after the messages emitted by checkout -f.
- if 2 <= infos.trace_level:
- print
+ prcs_checkout (prcs_revision + self.prjname ())
svn_repo = os.path.join(self.svn_project, infos.subdir, "trunk")
if len (infos.prcs_projects) > 1:
svn_repo = os.path.join(svn_repo, self.prcs_project)
@@ -440,7 +444,7 @@
def cmp_branch (self, prcs_revision):
xmkdir (self.prcs_project + prcs_revision + "_prcs")
xchdir (self.prcs_project + prcs_revision + "_prcs")
- xsystem("prcs checkout -f -r" + prcs_revision + " " +
self.prjname ())
+ prcs_checkout ("-r" + prcs_revision + " " + self.prjname ())
svn_repo = self.svn_project + "/" + os.path.join(infos.subdir,
"branches")
svn_repo = os.path.join(self.svn_project, infos.subdir, "branches")
if len(infos.prcs_projects) > 1:
@@ -778,7 +782,7 @@
# Set prev_prj to the PRCS parent project descriptor.
def project_parent_set(self):
if self.prj.parent_version.name() != self.prev_prj.version.name():
- xsystem("prcs checkout -f -r " + self.prj.parent_version.name() + "
" +\
+ prcs_checkout ("-r " + self.prj.parent_version.name() + " " +
self.prjname () + " " + self.prjname ())
self.prev_prj = self.prj_parser.parse(self.name + ".prj")
@@ -973,6 +977,7 @@
# Merge with parents.
def merge(self, prcsProject):
+ info ("> Preparing to merge.")
xchdir(os.path.join (self.workdir, self.svn.branch))
prcs_merged_parents = []
for prcs_merge_parent in prcsProject.prj.merge_parents:
@@ -1002,7 +1007,7 @@
"conflicts will be resolved later.",
prcsProject.create_date)
# Compute the intermediate project descriptor
- xsystem("prcs checkout -f -r " + prcs_merge_parent[0] + " " +
\
+ prcs_checkout ("-r " + prcs_merge_parent[0] + " " +
prcsProject.name + ".prj " + prcsProject.name +
".prj")
prcsProject.prev_prj = prcs.merge(prcsProject.prev_prj,
prcsProject.prj_parser.parse(prcsProject.name + ".prj"),
@@ -1017,7 +1022,7 @@
def synchronize(self, prcsProject):
info("> Checkout whole revision from PRCS repository")
xchdir(os.path.join (self.workdir, self.svn.branch))
- xsystem("prcs checkout -f -r " + prcsProject.prj.version.name() + \
+ prcs_checkout ("-r " + prcsProject.prj.version.name() +
" " + prcsProject.name + ".prj")
# Make a diff between previous and current prj's file.
diffs = prcs.diff(prcsProject.prev_prj, prcsProject.prj)
@@ -1036,7 +1041,7 @@
def convert_project_of_revision(self, prcsProject, prcs_version):
info("> Consider PRCS revision " + prcs_version.name())
xchdir(self.workdir)
- xsystem("prcs checkout -f -r " + prcs_version.name() + " " + \
+ prcs_checkout ("-r " + prcs_version.name() + " " +
prcsProject.name + ".prj " + prcsProject.name + ".prj")
prcsProject.parse()
if not self.ask_revision_proceed():
Show replies by date