chiark / gitweb /
hg deletes now all changes, so we get a unchanged, blank repo. this is also the behav...
authorKilian Holzinger <kilian.holzinger@gmail.com>
Thu, 12 Dec 2013 09:26:56 +0000 (10:26 +0100)
committerKilian Holzinger <kilian.holzinger@gmail.com>
Thu, 12 Dec 2013 09:26:56 +0000 (10:26 +0100)
fdroidserver/common.py

index 5b3d7c620234d897f3bf0787583122b36c612a18..51be2ae134503a5142ed9edfff1ccf622e8c74a9 100644 (file)
@@ -472,6 +472,12 @@ class vcs_hg(vcs):
         if subprocess.call(['hg', 'update', '-C', rev],
                 cwd=self.local) != 0:
             raise VCSException("Hg checkout failed")
+        #Also delete untracked files, we have to enable purge extension for that:
+        with open(self.local+"/.hg/hgrc", "a") as myfile:
+                       myfile.write("\n[extensions]\nhgext.purge=")
+        if subprocess.call(['hg', 'purge', '--all'],
+                       cwd=self.local) != 0:
+                               raise VCSException("HG purge failed")   
 
     def gettags(self):
         p = subprocess.Popen(['hg', 'tags', '-q'],