[codeface] Re: [PATCH 8/8] Check if database file is already in the directory

  • From: Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Sun, 01 Jun 2014 15:12:15 +0200

Hi Mitchell,

Am 31/05/2014 12:39, schrieb Mitchell Joblin:
- Avoid recreating the database file if it is already present
   this part of the analysis can be very time consuming
but that effectively invalidates the --create_db parameter, doesn't it?
Even when --create_db is specificed, the db file will be re-used,
making it harder to generate an analysis from scratch.

In particular, this can lead to very hard to track problems:
You've specified --create_db and are under the (valid) impression
that everything will be set up from scratch, while some probably
stale old data will be re-used. Since I've suffered a lot from
caching old runs in the mailing list analysis, I like to
preserve the opportunity to really start off in a clean state.

Or are there any use cases for the change that I'm missing? If
you don't specify --create_db and run an analysis multiple times,
you will anyway get the effect caused by the patch.

Cheers, Wolfgang

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
  codeface/cluster/cluster.py | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/codeface/cluster/cluster.py b/codeface/cluster/cluster.py
index d52d92e..99579dd 100755
--- a/codeface/cluster/cluster.py
+++ b/codeface/cluster/cluster.py
@@ -1303,6 +1303,8 @@ def doProjectAnalysis(conf, from_rev, to_rev, rc_start, 
outdir,
      #Perform appropriate analysis
      #----------------------------
      filename = os.path.join(outdir, "vcs_analysis.db")
+    ## Check if db file is already present
+    create_db = not(os.path.isfile(filename))
      dbm = DBManager(conf)
      performAnalysis(conf, dbm, filename, git_repo, [from_rev, to_rev],
  #                        kerninfo.subsysDescrLinux,


Other related posts: