Ce script est une *£&$
Index: ChangeLog
from Akim Demaille <akim(a)epita.fr>
* prcs2svn/prcs2svn.py (Svn.env_to_preserve_dates): New.
(Svn.changes_commit): Adjust.
Index: prcs2svn/prcs2svn.py
--- prcs2svn/prcs2svn.py (revision 104)
+++ prcs2svn/prcs2svn.py (working copy)
@@ -571,6 +571,23 @@
self.change_keywords_(path)
xchdir(pwd)
+ def env_to_preserve_dates (self):
+ "Return the environment assignment needed to preserve checkin dates."
+ res = ""
+ if infos.preserve_dates:
+ # FIXME: Well done! This way we are sure nothing will work
+ # properly if there are two concurrent runs. Use an env var!
+ fd = open ("/tmp/prcs2svn_time", "w+")
+ checkin_time = checkin_time[:checkin_time.rfind(" ")]
+ checkin_time = checkin_time[1:]
+ checkin_time = checkin_time[checkin_time.find(" ") + 1:]
+ fd.write (str (time.mktime (
+ time.strptime (checkin_time, "%d %b %Y
%H:%M:%S"))).split(".")[0])
+ fd.close ()
+ if infos.timelib_path:
+ res = "LD_LIBRARY_PATH=" + infos.timelib_path + " "
+ res += "LD_PRELOAD=libprcs2svntime.so "
+ return res
# Commit Subversion changes.
# Return 1 if a new version is really committed, else 0.
@@ -580,19 +597,7 @@
# Do commit.
# FIXME: `encoding' must be a command line option.
self.change_keywords(self.workdir)
- env = ""
- if infos.preserve_dates:
- fd = open ("/tmp/prcs2svn_time", "w+")
- checkin_time = checkin_time[:checkin_time.rfind(" ")]
- checkin_time = checkin_time[1:]
- checkin_time = checkin_time[checkin_time.find(" ") + 1:]
- fd.write(str(time.mktime(
- time.strptime(checkin_time, "%d %b %Y
%H:%M:%S"))).split(".")[0])
- fd.close()
- env = ""
- if len(infos.timelib_path) > 0:
- env = "LD_LIBRARY_PATH=" + infos.timelib_path + " "
- env += "LD_PRELOAD=libprcs2svntime.so "
+ env = self.env_to_preserve_dates ()
r = xtee (env + "svn commit --encoding latin1 " + \
"--username " + quote (checkin_login) + \
" --message " + quote (version_log))
Show replies by date