diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-19 09:10:25 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-19 09:10:25 -0500 |
commit | 4ad9a6d7b17db9abe7d4c11477df1df7c6eac5e5 (patch) | |
tree | ab2fe04f3e415b9bc9a8bb349e7accd3f232da1a /libbe/storage/vcs/arch.py | |
parent | 1a066af44dd6f5b3f0a3a7abe79f4f9baf7b74b3 (diff) | |
parent | 023bfa3195b3e45d1d12a6890f94e9c28b255f87 (diff) | |
download | bugseverywhere-4ad9a6d7b17db9abe7d4c11477df1df7c6eac5e5.tar.gz |
Merged be.faster-diff branch, fixing #bea/ed5#.
Diffstat (limited to 'libbe/storage/vcs/arch.py')
-rw-r--r-- | libbe/storage/vcs/arch.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/libbe/storage/vcs/arch.py b/libbe/storage/vcs/arch.py index f9ae32b..f9b01fd 100644 --- a/libbe/storage/vcs/arch.py +++ b/libbe/storage/vcs/arch.py @@ -27,7 +27,7 @@ import os import re import shutil import sys -import time +import time # work around http://mercurial.selenic.com/bts/issue618 import libbe import libbe.ui.util.user @@ -68,6 +68,7 @@ class Arch(base.VCS): self.versioned = True self.interspersed_vcs_files = True self.paranoid = False + self.__updated = [] # work around http://mercurial.selenic.com/bts/issue618 def _vcs_version(self): status,output,error = self._u_invoke_client('--version') @@ -288,7 +289,7 @@ class Arch(base.VCS): shutil.rmtree(arch_ids) def _vcs_update(self, path): - pass + self.__updated.append(path) # work around http://mercurial.selenic.com/bts/issue618 def _vcs_is_versioned(self, path): if '.arch-ids' in path: @@ -300,16 +301,29 @@ class Arch(base.VCS): return base.VCS._vcs_get_file_contents(self, path, revision) else: status,output,error = \ - self._invoke_client('file-find', path, revision) - relpath = output.rstrip('\n') + self._invoke_client( + 'file-find', '--unescaped', path, revision) + relpath = output.rstrip('\n').splitlines()[-1] + print >> sys.stderr, 'getting', relpath return base.VCS._vcs_get_file_contents(self, relpath) + def _vcs_path(self, id, revision): + raise NotImplementedError + def _vcs_commit(self, commitfile, allow_empty=False): if allow_empty == False: # arch applies empty commits without complaining, so check first status,output,error = self._u_invoke_client('changes',expect=(0,1)) if status == 0: - raise base.EmptyCommit() + # work around http://mercurial.selenic.com/bts/issue618 + time.sleep(1) + for path in self.__updated: + os.utime(os.path.join(self.repo, path), None) + self.__updated = [] + status,output,error = self._u_invoke_client('changes',expect=(0,1)) + if status == 0: + # end work around + raise base.EmptyCommit() summary,body = self._u_parse_commitfile(commitfile) args = ['commit', '--summary', summary] if body != None: @@ -342,6 +356,9 @@ class Arch(base.VCS): return None return '%s--%s' % (self._archive_project_name(), log) + def _vcs_changed(self, revision): + raise NotImplementedError + if libbe.TESTING == True: base.make_vcs_testcase_subclasses(Arch, sys.modules[__name__]) |