diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-13 19:40:06 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-13 19:40:06 -0500 |
commit | 5fb31c1fa646de076b999532690375319b5d4eb6 (patch) | |
tree | 130f6e97f9051b3680c90e3d3dade3ed83b96589 | |
parent | e8a0ff2488d1535cea0528aa1c7b9ef8aa43dfed (diff) | |
download | bugseverywhere-5fb31c1fa646de076b999532690375319b5d4eb6.tar.gz |
Work around mercurial (hg) issue 618.
-rw-r--r-- | libbe/storage/vcs/hg.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libbe/storage/vcs/hg.py b/libbe/storage/vcs/hg.py index 633987a..776d986 100644 --- a/libbe/storage/vcs/hg.py +++ b/libbe/storage/vcs/hg.py @@ -25,6 +25,7 @@ import os import os.path import re import shutil +import time # work around http://mercurial.selenic.com/bts/issue618 import libbe import base @@ -45,6 +46,7 @@ class Hg(base.VCS): def __init__(self, *args, **kwargs): base.VCS.__init__(self, *args, **kwargs) self.versioned = True + self.__updated = [] # work around http://mercurial.selenic.com/bts/issue618 def _vcs_version(self): status,output,error = self._u_invoke_client('--version') @@ -80,7 +82,7 @@ class Hg(base.VCS): self._u_invoke_client('rm', '--force', path) def _vcs_update(self, path): - pass + self.__updated.append(path) # work around http://mercurial.selenic.com/bts/issue618 def _vcs_get_file_contents(self, path, revision=None): if revision == None: @@ -93,6 +95,16 @@ class Hg(base.VCS): def _vcs_commit(self, commitfile, allow_empty=False): args = ['commit', '--logfile', commitfile] status,output,error = self._u_invoke_client(*args) + # work around http://mercurial.selenic.com/bts/issue618 + strings = ['nothing changed'] + if self._u_any_in_string(strings, output) == True \ + and len(self.__updated) > 0: + time.sleep(1) + for path in self.__updated: + os.utime(os.path.join(self.repo, path), None) + status,output,error = self._u_invoke_client(*args) + self.__updated = [] + # end work around if allow_empty == False: strings = ['nothing changed'] if self._u_any_in_string(strings, output) == True: |