Commits

Ivo Hinkelmann  committed 5c9defa

contl10n01: fix for hg add / verify issue

  • Participants
  • Parent commits 97b3578

Comments (0)

Files changed (1)

File l10ntools/scripts/tool/commands.py

         myui = ui.ui()
         repo = hg.repository(myui, self._cws_root_dir + "/l10n/" )
         ### hg add ###
-        #if len(self._new_files) > 0:
-        #    add_list = []
-        #    for lang in self._new_files:
-        #        add_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang+"/localize.sdf")
-        #    add_errmsg = "Execution failed of hg add files " + str(" ".join(add_list)) + "'\n"
-        #    out_v = utils.Util.hg_cmd(commands.add, self._log, add_errmsg, myui, repo, *add_list)        
+        if len(self._new_files) > 0:
+            add_list = []
+            for lang in self._new_files:
+                add_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang+"/localize.sdf")
+            add_errmsg = "Execution failed of hg add files " + str(" ".join(add_list)) + "'\n"
+            out_v = utils.Util.hg_cmd(commands.add, self._log, add_errmsg, myui, repo, *add_list)        
+        
+        repo = None
+        time.sleep(1)
+        repo = hg.repository(myui, self._cws_root_dir + "/l10n/" )
 
         #### hg commit ###
         if self._commit_all == "True":         # commit all
             file_list = []
             for lang in self._files_modified:
                 file_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang + "/localize.sdf")
-            #for lang in self._new_files:
-            #    file_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang + "/localize.sdf")        
+            for lang in self._new_files:
+                file_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang + "/localize.sdf")        
             if len(file_list) == 0:
                 self._log.die("There is nothing to hg commit ?!?! Is this correct?!")
             commit_errmsg = "Execution failed of hg commit '" + " ".join(file_list) + "'\n"             
             out_v = utils.Util.hg_cmd(commands.commit, self._log, commit_errmsg, myui, repo, *file_list , message=self._commit_msg)
 
+        repo = None
+        time.sleep(1)
+        repo = hg.repository(myui, self._cws_root_dir + "/l10n/" )
+
+
         #time.sleep(5)
         ### hg verify ###
         if len(self._new_files) > 0 or len(self._files_modified) > 0: