mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
Merge branch 'hg-gotorevisionx' into 'master'
Fix local build scenario with Mercurial repositories See merge request fdroid/fdroidserver!1560
This commit is contained in:
commit
801d6f9566
1 changed files with 2 additions and 12 deletions
|
@ -1697,11 +1697,11 @@ class vcs_hg(vcs):
|
||||||
self.clone_failed = True
|
self.clone_failed = True
|
||||||
raise VCSException("Hg clone failed", p.output)
|
raise VCSException("Hg clone failed", p.output)
|
||||||
else:
|
else:
|
||||||
p = FDroidPopen(['hg', 'status', '-uS'], cwd=self.local, output=False)
|
p = FDroidPopen(['hg', 'status', '-uiS'], cwd=self.local, output=False)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise VCSException("Hg status failed", p.output)
|
raise VCSException("Hg status failed", p.output)
|
||||||
for line in p.output.splitlines():
|
for line in p.output.splitlines():
|
||||||
if not line.startswith('? '):
|
if not line.startswith('? ') and not line.startswith('I '):
|
||||||
raise VCSException("Unexpected output from hg status -uS: " + line)
|
raise VCSException("Unexpected output from hg status -uS: " + line)
|
||||||
FDroidPopen(['rm', '-rf', '--', line[2:]], cwd=self.local, output=False)
|
FDroidPopen(['rm', '-rf', '--', line[2:]], cwd=self.local, output=False)
|
||||||
if not self.refreshed:
|
if not self.refreshed:
|
||||||
|
@ -1716,16 +1716,6 @@ class vcs_hg(vcs):
|
||||||
p = FDroidPopen(['hg', 'update', '-C', '--', rev], cwd=self.local, output=False)
|
p = FDroidPopen(['hg', 'update', '-C', '--', rev], cwd=self.local, output=False)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise VCSException("Hg checkout of '%s' failed" % rev, p.output)
|
raise VCSException("Hg checkout of '%s' failed" % rev, p.output)
|
||||||
p = FDroidPopen(['hg', 'purge', '--all'], cwd=self.local, output=False)
|
|
||||||
# Also delete untracked files, we have to enable purge extension for that:
|
|
||||||
if "'purge' is provided by the following extension" in p.output:
|
|
||||||
with open(os.path.join(self.local, '.hg', 'hgrc'), "a") as myfile:
|
|
||||||
myfile.write("\n[extensions]\nhgext.purge=\n")
|
|
||||||
p = FDroidPopen(['hg', 'purge', '--all'], cwd=self.local, output=False)
|
|
||||||
if p.returncode != 0:
|
|
||||||
raise VCSException("HG purge failed", p.output)
|
|
||||||
elif p.returncode != 0:
|
|
||||||
raise VCSException("HG purge failed", p.output)
|
|
||||||
|
|
||||||
def _gettags(self):
|
def _gettags(self):
|
||||||
p = FDroidPopen(['hg', 'tags', '-q'], cwd=self.local, output=False)
|
p = FDroidPopen(['hg', 'tags', '-q'], cwd=self.local, output=False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue