Commits

Anonymous committed 117f5ed

FIX: autosync messed up

Comments (0)

Files changed (4)

 54c2fa4d1f030844320ced46b28b70f9edc4a5be 0.3
 f5f816493470f879b927a2912aed5a9731831896 0.3
 848ea472b5b7b47c0e30a57c587cad9cd28390d4 0.4
+59d7b13baef6bc25ce93a5a2fbea9ea5d94f90d7 0.5
 def hg_modify_config(project_dir):
     "Writes config to do auto update after hg push."
     hgrc_src = 'hgrc.template'
+    hgtags_src = 'hgtags.template'
     hgignore_src = 'hgignore.template'
     hgrc_dst = os.path.join(project_dir, '.hg', 'hgrc')
+    hgtags_dst = os.path.join(project_dir, '.hg', '.hgtags')
     hgignore_dst = os.path.join(project_dir, '.hgignore')
-    configpairs = [(hgrc_src, hgrc_dst), (hgignore_src, hgignore_dst)]
+    configpairs = [(hgrc_src, hgrc_dst),
+                   (hgignore_src, hgignore_dst),
+                   (hgtags_src, hgtags_dst)]
     for src, dst in configpairs:
         if os.path.exists(src) and not os.path.exists(dst):
             shutil.copy(src, dst)
                 fd_lockflag = os.path.join(project_dir, fn_lockflag)
                 if os.path.exists(fd_lockflag): continue
                 if not os.path.exists(fd_hgflag):
+                    os.environ['HGUSER'] = 'root'
                     init(project_dir)
-                hg_modify_config(project_dir)
+                    hg_modify_config(project_dir)
+                    commit(project_dir, "First Commit")
                 if os.path.exists(fd_syncflag):
                     sleep(0.2)
                     user, comment = parse_flag(fd_syncflag)
 def branch(dest, br_name, u=ui.ui()):
     "hg branch br_name"
     repo = hg.repository(u, dest)
-    return commands.branch(u, repo, label=br_name)
+    return commands.branch(u, repo, label=br_name, force=True)
 
 def autobranch(dest, u=ui.ui()):
     "Create new branch if repo is changed"

hgtags.template

Empty file added.