def author(self): """The creator of the file (commiter of the first revision of the file).""" if self._first_changeset: return hg2u(self._first_changeset.user()) try: return hg2u(self._ctx.user()) except: pass
def author(self): """The creator of the file (commiter of the first revision of the file).""" author = hg2u(self._first_changeset.user()) if author == u'': try: author = hg2u(self._ctx.user()) except: pass return author
def test_needs_reload(self): ctx = self.get_ctx() self.assertTrue(ctx.needs_reload()) # add a file to repo with codecs.open(os.path.join(hg2u(self.repo.path), 'a.rst'), 'w', encoding='utf-8') as fp: fp.write('testing\n') # should always be true self.assertTrue(ctx.needs_reload()) commands.commit(self.ui, self.repo, message=b'foo', user=b'foo', addremove=True) # should need a reload now, after the commit self.assertTrue(ctx.needs_reload()) # reload ctx = self.get_ctx() # should still need a reload, right after the reload self.assertTrue(ctx.needs_reload())
def files(self): files = set(self._ctx.manifest().keys()) try: files = files.union(set(self._extra_files)) except: pass rv = [] for i in sorted(files): rv.append(hg2u(i)) return rv
def content(self): """UTF-8 encoded content of the file.""" return hg2u(self.data)
def path(self): """UTF-8 encoded file path, relative to the repository root.""" return hg2u(self._ctx.path())