Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
    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())
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 def content(self):
     """UTF-8 encoded content of the file."""
     return hg2u(self.data)
Ejemplo n.º 6
0
 def path(self):
     """UTF-8 encoded file path, relative to the repository root."""
     return hg2u(self._ctx.path())
Ejemplo n.º 7
0
 def content(self):
     """UTF-8 encoded content of the file."""
     return hg2u(self.data)
Ejemplo n.º 8
0
 def path(self):
     """UTF-8 encoded file path, relative to the repository root."""
     return hg2u(self._ctx.path())