Index: trunk/ChangeLog
from Benoît Perrot <benoit(a)lrde.epita.fr>
Factor boolean tasks.
* src/task/boolean_task.hh, src/task/boolean_task.cc:
* src/task/Makefile.am:
Distribute new files.
* src/vm/vm-tasks.hh, src/vm/vm-tasks.cc,
* src/task/libtask.hh:
Use boolean tasks.
2004-09-18 Benoît Perrot <benoit(a)lrde.epita.fr>
Index: trunk/src/task/boolean_task.hh
--- trunk/src/task/boolean_task.hh (revision 0)
+++ trunk/src/task/boolean_task.hh (revision 122)
@@ -0,0 +1,44 @@
+//
+// This file is part of Nolimips, a MIPS simulator with unlimited registers
+// Copyright (C) 2004 Akim Demaille <akim(a)epita.fr> and
+// Benoit Perrot <benoit(a)lrde.epita.fr>
+//
+// Nolimips is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// Nolimips is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+#ifndef TASK_BOOLEAN_TASK_HH
+# define TASK_BOOLEAN_TASK_HH
+
+#include "task/task.hh"
+
+namespace task
+{
+
+ class BooleanTask: public Task
+ {
+ public:
+ BooleanTask(bool &flag,
+ const std::string& option, const std::string& module_name,
+ const std::string& desc, const std::string& deps = "");
+
+ public:
+ virtual void execute() const;
+
+ private:
+ mutable bool &flag_;
+ };
+
+} // namespace task
+
+#endif // !TASK_BOOLEAN_TASK_HH
Index: trunk/src/task/boolean_task.cc
--- trunk/src/task/boolean_task.cc (revision 0)
+++ trunk/src/task/boolean_task.cc (revision 122)
@@ -0,0 +1,41 @@
+//
+// This file is part of Nolimips, a MIPS simulator with unlimited registers
+// Copyright (C) 2004 Akim Demaille <akim(a)epita.fr> and
+// Benoit Perrot <benoit(a)lrde.epita.fr>
+//
+// Nolimips is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// Nolimips is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+
+#include "task/boolean_task.hh"
+
+namespace task
+{
+
+ BooleanTask::BooleanTask(bool &flag,
+ const std::string& option,
+ const std::string& module_name,
+ const std::string& desc,
+ const std::string& deps):
+ Task(option, module_name, desc, deps),
+ flag_(flag)
+ {}
+
+ void
+ BooleanTask::execute (void) const
+ {
+ flag_ = true;
+ }
+
+} //namespace task
Index: trunk/src/task/libtask.hh
--- trunk/src/task/libtask.hh (revision 121)
+++ trunk/src/task/libtask.hh (revision 122)
@@ -22,21 +22,32 @@
# define TASK_LIBTASK_HH
# include "task/function_task.hh"
+# include "task/boolean_task.hh"
# ifdef NOLIMIPS_CC_
# define TASK_MODULE(Name) \
const char module_name [] = Name;
+
# define TASK_DECLARE(Option, Desc, Routine, Deps) \
extern void (Routine) (void); \
- task::FunctionTask task_##Routine (Routine, \
+ static task::FunctionTask task_##Routine (Routine, \
Option, module_name, \
Desc, Deps)
+
+# define BOOLEAN_TASK_DECLARE(Option, Desc, Flag, Deps) \
+ bool Flag; \
+ static task::BooleanTask task_##Flag(Flag, \
+ Option, module_name, \
+ Desc, Deps)
+
# else // !NOLIMIPS_CC_
# define TASK_MODULE(Name)
# define TASK_DECLARE(Name, Help, Routine, Dependencies) \
extern void (Routine) (void)
+# define BOOLEAN_TASK_DECLARE(Name, Help, Flag, Dependencies)\
+ extern bool Flag
# endif // NOLIMIPS_CC_
Index: trunk/src/task/Makefile.am
--- trunk/src/task/Makefile.am (revision 121)
+++ trunk/src/task/Makefile.am (revision 122)
@@ -4,6 +4,7 @@
libtask_a_SOURCES = \
task.hh task.cc \
function_task.hh function_task.cc \
+ boolean_task.hh boolean_task.cc \
task_register.hh task_register.cc \
libtask.hh \
task-tasks.hh task-tasks.cc
Index: trunk/src/vm/vm-tasks.hh
--- trunk/src/vm/vm-tasks.hh (revision 121)
+++ trunk/src/vm/vm-tasks.hh (revision 122)
@@ -29,13 +29,13 @@
TASK_MODULE ("3. Virtual Machine");
- TASK_DECLARE ("check-callee-save",
+ BOOLEAN_TASK_DECLARE ("check-callee-save",
"Warn if a callee save register "
"is not preserved across a call",
- check_callee_save, "");
+ check_callee_save_p, "");
- TASK_DECLARE ("E|trace-exec", "Trace the execution",
- trace_exec, "");
+ BOOLEAN_TASK_DECLARE ("E|trace-exec", "Trace the execution",
+ trace_exec_p, "");
TASK_DECLARE ("e|execute", "Execute the program on virtual machine",
execute, "prg-solve");
Index: trunk/src/vm/vm-tasks.cc
--- trunk/src/vm/vm-tasks.cc (revision 121)
+++ trunk/src/vm/vm-tasks.cc (revision 122)
@@ -29,20 +29,6 @@
namespace tasks
{
- static bool check_callee_save_p = false;
- void
- check_callee_save ()
- {
- check_callee_save_p = true;
- }
-
- static bool trace_exec_p = false;
- void
- trace_exec ()
- {
- trace_exec_p = true;
- }
-
void
execute ()
{
Euh... Est-ce qu'elle a déjà _vraiment_ fonctionné cette option ???
Même le test dit de "cohérence" est incohérent...
- if (date_d > dd and date_d < de) or \
- (date_e > dd and date_e < dd):
Index: ChangeLog
from Akim Demaille <akim(a)epita.fr>
* prcs2svn/prcs2svn.py (Prcs2svn.test_date_coherency):
Well... almost rewrite it.
Use understandable variable names.
Use readable date formats.
Issue readable error messages.
Don't run when not required.
(DatesSuperposition.mesg): Enhance the informational contents.
Index: prcs2svn/prcs2svn.py
--- prcs2svn/prcs2svn.py (revision 98)
+++ prcs2svn/prcs2svn.py (working copy)
@@ -55,9 +55,11 @@
AbstractError.__init__(self, self.mesg)
class DatesSuperposition(AbstractError):
- mesg = "The dates of your projects must not be superposed (don't use -p)."
- def __init__(self):
- AbstractError.__init__(self, self.mesg)
+ mesg = "These projects have overlapping chronologies (don't use -p)."
+ def __init__(self, p1, d1b, d1e, p2, d2b, d2e):
+ AbstractError.__init__(self,
+ "%s\n %s (%s -- %s)\n %s (%s -- %s)" %
+ (self.mesg, p1, d1b, d1e, p2, d2b, d2e))
class SvnCopyForbidden(AbstractError):
mesg = "You must copy the svn repository via file system"
@@ -785,6 +787,8 @@
## Test.
def test_date_coherency(self):
+ if not infos.preserve_dates:
+ return
info("> Test date coherency of projects")
dates = []
for project in infos.prcs_projects:
@@ -794,23 +798,28 @@
prcs_info = xpopen("prcs info --plain-format -f --sort=date " +\
project + ".prj | sed -ne \"1p;\$p\"" +\
" | sed -e \"s/.*, \(.*\) +[0-9]* by .*/\\1/\"" )
- f_date = ""
- l_date = ""
+ begin = ""
+ end = ""
for f in prcs_info:
- if len(f_date) == 0:
- f_date = f[:-1]
+ if begin:
+ end = f[:-1]
else:
- l_date = f[:-1]
- dates.append((time.mktime(time.strptime(f_date, "%d %b %Y %H:%M:%S")),
- time.mktime(time.strptime(l_date, "%d %b %Y %H:%M:%S")),
- project))
+ begin = f[:-1]
prcs_info.close()
- for (date_d, date_e, proj) in dates:
- for (dd, de, p) in dates:
- if p != proj:
- if (date_d > dd and date_d < de) or \
- (date_e > dd and date_e < dd):
- raise DatesSuperposition()
+ # DATES will be sorted by date, so leave BEGIN first.
+ dates.append ((time.strftime ("%F %T",
+ time.strptime (begin,
+ "%d %b %Y %H:%M:%S")),
+ time.strftime ("%F %T",
+ time.strptime (end, "%d %b %Y %H:%M:%S")),
+ project))
+ # Proj, Begin, End.
+ for (b1, e1, p1) in dates:
+ for (b2, e2, p2) in dates:
+ if p1 != p2:
+ if not (e2 < b1 or e1 < b2):
+ raise DatesSuperposition (p1, b1, e1,
+ p2, b2, e2)
dates.sort()
infos.prcs_projects = [z for (x,y,z) in dates]
La conversion du rapport technique n°0307 plante. En gros, il y a un
merge dans ce rapport: la version 0.7 est fille de 0.3 (pas de 0.6) et entre
les deux, un répertoire a disparu avec son contenu, mais le contenu réapparaît
ailleurs dans 0.7.
prcs2svn commence par effacer l'ancien répertoire, puis tente de déplacer son
contenu au nouvel emplacement.
La partie coupable de prcs2svn se trouve en fin de la méthode merge:
,----
| # Fix tc's bug
| if prcs_merge_parent != prcsProject.prj.merge_parents[-1]:
| self.svn.changes_apply_files_directories_delete(diffs)
`-----
Étant donné le caractère douteux de ce code, et compte tenu du commentaire qui
le précède de surcroît, je suggère que ces lignes soient optionnelles, et
désactivées par défaut.
--
Didier Verna, didier(a)lrde.epita.fr, http://www.lrde.epita.fr/~didier
EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85
94276 Le Kremlin-Bicêtre, France Fax.+33 (1) 53 14 59 22 didier(a)xemacs.org
2004-09-13 Akim Demaille <akim(a)epita.fr>
* guidelines.texi: Fix uses of @samp instead of @example.
(ChangeLog Do): Merges.
(Top): Fix locations.
--- /mnt/dload/guidelines/guidelines.txt 2004-08-26 11:56:36.000000000 +0200
+++ guidelines.txt 2004-09-13 12:21:29.000000000 +0200
@@ -1,17 +1,15 @@
LRDE Guidelines
***************
- This document, last edited on August 26, 2004, is a guideline for LRDE
-members. It is available under various forms:
- - Maintain in a single HTML file(1).
+ This document, last edited on September 13, 2004, is a guideline for
+LRDE members. It is available under various forms:
+ - Guidelines in a several HTML file(1).
- - Maintain in several HTML files(2).
+ - Guidelines in PDF(2).
- - Maintain in PDF(3).
+ - Guidelines in text(3).
- - Maintain in text(4).
-
- - Maintain in Info(5).
+ - Guidelines in Info(4).
Some sections are (almost) verbatim copies of texts written by Raphaël
Poss.
@@ -59,15 +57,13 @@
---------- Footnotes ----------
- (1) `http://www.lrde.epita.fr/dload/guidelines/maintain.html'.
-
- (2) `http://www.lrde.epita.fr/dload/guidelines/maintain.split'.
+ (1) `http://www.lrde.epita.fr/dload/guidelines/guidelines.html'.
- (3) `http://www.lrde.epita.fr/dload/guidelines/maintain.pdf'.
+ (2) `http://www.lrde.epita.fr/dload/guidelines/guidelines.pdf'.
- (4) `http://www.lrde.epita.fr/dload/guidelines/maintain.txt'.
+ (3) `http://www.lrde.epita.fr/dload/guidelines/guidelines.txt'.
- (5) `http://www.lrde.epita.fr/dload/guidelines/maintain.info'.
+ (4) `http://www.lrde.epita.fr/dload/guidelines/guidelines.info'.
1 Introduction
**************
@@ -881,11 +877,32 @@
- ChangeLog entries are basically write-once, especially items far in the
past: if you change them, one might have problems tracing a change
- which description changed. Nevertheless, fix mistakes in recent
- entries. If details on a patch are asked, it is probably the sign the
+ which description changed. Nevertheless, *fix mistakes in recent
+ entries*. If details on a patch are asked, it is probably the sign the
ChangeLog was incomplete: complete it! Don't file a ChangeLog entry
for ChangeLog entry fixes.
+ - When *merging a branch* add a tabulation to the added ChangeLog
+ headers, and past all this into your new ChangeLog. Here is an
+ example:
+
+ 2003-10-01 Raphaël Poss <raph(a)lrde.epita.fr>
+
+ Merge the following changes.
+
+ 2003-10-01 Raphaël Poss <raph(a)lrde.epita.fr>
+
+ * src/translate/translation.cc: Fix bug where reference to
+ temporaries were stored in the heap.
+
+ 2003-09-30 Raphaël Poss <raph(a)lrde.epita.fr>
+
+ * Synchronize with main project.
+
+ [...]
+
+ * src/misc/Makefile.am: Mention the new files.
+
6.2.3 ChangeLog Don't
---------------------
@@ -969,24 +986,24 @@
_2. Update your local copy_
To get the lastest changes:
- `$ prcs merge'
+ $ prcs merge
If you have not changed the prj file so far, run:
- `$ prcs checkout myproject myproject.prj'
+ $ prcs checkout myproject myproject.prj
This helps keeping the prj file clean.
_3. Add and remove new/obsolete files_
Get the list of files prcs would add/remove:
- `$ prcs populate -dn'
+ $ prcs populate -dn
Generated files or junk files may be listed. Add them to the
diff-ignore section of the .prj file. When `populate -dn' gives a
clean list of new files, run:
- `$ prcs populate -d'
+ $ prcs populate -d
to add/remove effectively the new/old files into the .prj.
Index: ChangeLog
from Akim Demaille <akim(a)epita.fr>
* prcs2svn/prcs2svn.py: Make all the info calls similar, without
leading spaces in the message.
(xsystem, xtee): Fix the handling of ignErr (was reversed).
Index: prcs2svn/prcs2svn.py
--- prcs2svn/prcs2svn.py (revision 93)
+++ prcs2svn/prcs2svn.py (working copy)
@@ -108,7 +108,7 @@
cmd += "> /dev/null 2> /dev/null"
status = os.system(cmd)
if status:
- error (int (ignErr),
+ error (int (not ignErr),
cmd + ": returned an error (" + status.__str__ () + ")")
def xpopen(cmd, ignErr=False):
@@ -129,7 +129,7 @@
# What is this supposed to return? There is nothing in the doc! --akim
status = pipe.close ()
if status:
- error (int (ignErr), cmd + ": returned an error (" + status + ")")
+ error (int (not ignErr), cmd + ": returned an error (" + status + ")")
return res
def xtee (cmd, ignErr=False):
Je ne vous cache pas être singulièrement déçu de trouver des choses
pareilles dans prcs2svn. Bon sang, on n'a plus ce niveau-là !!!
Je ne parle même de la boucle for qui peut certainement s'écrire avec
un map (mais je ne connais pas assez Python pour l'instant).
Index: ChangeLog
from Akim Demaille <akim(a)epita.fr>
Factor!
* prcs2svn/prcs2svn.py (Svn.changes_apply_add): New, replaces...
(Svn.changes_apply_directories_add)
(Svn.changes_apply_links_add)
(Svn.changes_apply_files_add): these similar routines.
BTW, kill some meaningless, and probably antique, comments.
Index: prcs2svn/prcs2svn.py
--- prcs2svn/prcs2svn.py (revision 92)
+++ prcs2svn/prcs2svn.py (working copy)
@@ -601,31 +601,19 @@
f.write("Symbolic link to: " + ref + "\n")
f.close()
- # Add directories.
- # The destination of a renaming may be in a new directory.
- def changes_apply_directories_add(self, diffs):
- if len(diffs.added_dirs):
- info(" > Add directories to Subversion repository")
+
+ def changes_apply_add (self, kind, list):
+ "svn add the new KIND entities in LIST."
+ if list:
+ info(" > Add " + kind + " to Subversion repository")
args = ""
- for d in diffs.added_dirs:
+ for d in list:
info(" * " + d)
- args = args + " " + quote(d)
+ args += " " + quote (d)
if infos.action:
xsystem("svn add --non-recursive" + args)
- # Add Links.
- # FIXME: bad trick to convert some projects.
- def changes_apply_links_add(self, diffs):
- if len(diffs.links):
- info(" > Add links to Subversion repository")
- args = ""
- for l in diffs.links:
- info(" * " + l)
- args = args + " " + quote(l)
- if infos.action:
- xsystem("svn add --non-recursive" + args)
-
# Rename files.
# The source always exists and so does the destination directory.
def changes_apply_files_rename(self, diffs, checkin_login, version_log, \
@@ -673,18 +661,6 @@
for b in backup.keys():
xmove(backup[b], b)
- # Add files.
- # Hard to explain, see movement of "Makefile.am" in oln 0_7_reconf.1.prj.
- def changes_apply_files_add(self, diffs):
- if len(diffs.added_files):
- info(" > Add files to Subversion repository")
- args = ""
- for f in diffs.added_files:
- info(" * " + f)
- args = args + " " + quote(f)
- if infos.action:
- xsystem("svn add --non-recursive" + args)
-
# Delete directories and files.
# Deleting a directory may delete a source of a renaming.
def changes_apply_files_directories_delete(self, diffs):
@@ -706,11 +682,11 @@
# Be careful: the order is very important!
def changes_apply(self, diffs, checkin_login, version_log, checkin_time):
self.changes_apply_links_replace(diffs)
- self.changes_apply_directories_add(diffs)
- self.changes_apply_links_add(diffs)
+ self.changes_apply_add ("directories", diffs.added_dirs)
+ self.changes_apply_add ("symlinks", diffs.links)
self.changes_apply_files_rename(diffs, checkin_login, version_log,
checkin_time)
- self.changes_apply_files_add(diffs)
+ self.changes_apply_add ("files", diffs.added_files)
self.changes_apply_files_directories_delete(diffs)