============================= test process starts ==============================
executable:   /usr/bin/python  (2.6.2-final-0)
using py lib: /usr/lib/python2.6/dist-packages/py <rev unknown>

MoinMoin/_tests/test_Page.py - skipped
MoinMoin/_tests/test_PageEditor.py - skipped
MoinMoin/_tests/test_caching.py[7] .......
MoinMoin/_tests/test_error.py[4] ....
MoinMoin/_tests/test_packages.py - skipped
MoinMoin/_tests/test_sourcecode.py[129] .....................................................................................F...........................................
MoinMoin/_tests/test_test_environ.py[4] ....
MoinMoin/_tests/test_user.py[14] ..............
MoinMoin/_tests/test_wikisync.py - skipped
MoinMoin/_tests/test_wikiutil.py[174] ..............................................................................................................................................................................
MoinMoin/_tests/test_wsgiapp.py[6] ......
MoinMoin/auth/_tests/test_auth.py - skipped
MoinMoin/auth/_tests/test_ldap_login.py - skipped
MoinMoin/config/_tests/test_configs.py[1] .
MoinMoin/config/_tests/test_multiconfig.py[1] .
MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py[94] ..ss........ssss...ssssssssssssssssss.s.s...ssssssssssssssssssssssssssssssssss................
MoinMoin/datastruct/backends/_tests/test_composite_dicts.py[3] ...
MoinMoin/datastruct/backends/_tests/test_composite_groups.py[13] .............
MoinMoin/datastruct/backends/_tests/test_config_dicts.py[3] ...
MoinMoin/datastruct/backends/_tests/test_config_groups.py[9] .........
MoinMoin/datastruct/backends/_tests/test_lazy_config_groups.py[27] ..........F................
MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py[3] ...
MoinMoin/datastruct/backends/_tests/test_wiki_groups.py[16] ............FFFF
MoinMoin/events/_tests/test_events.py - skipped
MoinMoin/filter/_tests/test_filter.py[4] ....
MoinMoin/formatter/_tests/test_formatter.py[156] ss..........................................................................................................................................................
MoinMoin/formatter/_tests/test_groups.py[18] .........sssssssss
MoinMoin/items/_tests/test_Item.py[4] ....
MoinMoin/macro/_tests/test_FootNote.py[1] .
MoinMoin/macro/_tests/test_GetVal.py - skipped
MoinMoin/macro/_tests/test_PageHits.py[1] .
MoinMoin/macro/_tests/test_macro.py[1] .
MoinMoin/mail/_tests/test_sendmail.py[9] .........
MoinMoin/parser/_tests/test_text_creole.py[25] .........................
MoinMoin/parser/_tests/test_text_csv.py[3] ...
MoinMoin/parser/_tests/test_text_moin_wiki.py[39] ........s..............................
MoinMoin/parser/_tests/test_unicode.py[1] .
MoinMoin/search/_tests/test_search.py[14] ............s.
MoinMoin/search/_tests/test_terms.py[186] ..........................................................................................................................................................................................
MoinMoin/security/_tests/test_security.py[148] ....................................................................................................................................................
MoinMoin/storage/_tests/test_backends.py[0] 
MoinMoin/storage/_tests/test_backends_flatfile.py - skipped
MoinMoin/storage/_tests/test_backends_fs.py[122] ..........................................................................................................................
MoinMoin/storage/_tests/test_backends_fs19.py[16] ................
MoinMoin/storage/_tests/test_backends_hg.py[121] FFFFFFFFFFFFFFFFFFFFFFFF........................F....F....FF..F.FFFFF.FFFFFFFFFF.F.......F..F.FFF.FFFFFFFFFFFFFFFF...FFFs


__________________________ reasons for skipped tests ___________________________
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:725
reason: Skipped: 'Broken.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/parser/_tests/test_text_moin_wiki.py:213
reason: Skipped: 'Broken'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_wikisync.py:10
reason: Skipped: 'Broken, tests and wikisync code need item refactoring.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/auth/_tests/test_ldap_login.py:10
reason: Skipped: 'Broken due to test Config refactoring'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/auth/_tests/test_auth.py:133
reason: Skipped: 'We currently have no http auth code in moin. GivenAuth relies on the web server doing the http auth check.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_formatter.py:29
reason: Skipped: 'docbook is broken'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_formatter.py:17
reason: Skipped: 'domxml <p> generation is broken'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1158
reason: Skipped: 'xml.dom.ext module is not available'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_packages.py:15
reason: Skipped: 'Broken. Needs AttachFile/Page -> Item refactoring.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_PageEditor.py:11
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_Page.py:10
reason: Skipped: 'Broken. Needs Page -> Item refactoring.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_groups.py:124
reason: Skipped: 'Currently broken, misses Page -> Item refactoring and/or correct format detection.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_flatfile.py:11
reason: Skipped: 'BackendTest base class tests quite some stuff that this very simple backend does not provide'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:116
reason: Skipped: 'expected to fail'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/search/_tests/test_search.py:119
reason: Skipped: "Won't work before Xapian code is refactored and adjusted to work with new storage"

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/macro/_tests/test_GetVal.py:11
reason: Skipped: 'Broken. Needs Page->Item refactoring.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/events/_tests/test_events.py:10
reason: Skipped: 'Needs Page -> Item refactoring. MoinMoin.items needs to call event code.'

Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1051
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1045
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1174
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:317
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:257
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:486
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:104
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:564
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:592
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:465
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:507
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:877
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:858
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:279
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1081
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:547
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1015
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:445
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:679
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:660
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1027
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:115
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1105
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1039
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:764
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:945
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:603
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:973
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:404
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1184
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:643
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:896
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1003
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:424
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1133
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:628
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1139
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:614
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:528
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:581
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1111
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1069
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1063
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1093
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1145
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:694
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:917
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1087
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1057
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1099
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1021
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:298
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1033
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1075
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:847
Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1009
reason: Skipped: 'broken test'

________________________________________________________________________________
_______________________ entrypoint: test_sourcecode[85] ________________________

    def check_py_file(reldir, path, mtime):
        if TRAILING_SPACES == 'fix':
            f = file(path, 'rb')
            data = f.read()
            f.close()
            fixed = FIX_TS_RE.sub('', data)
    
            # Don't write files if there's no need for that,
            # as altering timestamps can be annoying with some tools.
            if fixed == data:
                return
    
            f = file(path, 'wb')
            f.write(fixed)
            f.close()
        # Please read and follow PEP8 - rerun this test until it does not fail any more,
        # any type of error is only reported ONCE (even if there are multiple).
        error_count = pep8_error_count(path)
E       assert error_count == 0
>       assert 1 == 0

[/home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_sourcecode.py:95]
- - - - - - - - - - - - - -  [85]: recorded stdout - - - - - - - - - - - - - - -
/home/user/workspace/moin-2.0-storage/MoinMoin/script/migration/backend.py:67:1: W291 trailing whitespace

^

________________________________________________________________________________
___ entrypoint: test_lazy_config_groups.py TestLazyConfigGroups().test_iter ____

    def test_iter(self):
        groups = self.request.groups
    
        for group, members in self.expanded_groups.iteritems():
            returned_members = list(groups[group])
E           assert len(returned_members) == len(members)
>           assert 5 == 3
             +  where 5 = len([u'John', u'JoeDoe', u'Editor1', u'Admin1', u'Admin2'])
             +  and   3 = len([u'John', u'JoeDoe', u'Editor1'])

[/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/__init__.py:65]
________________________________________________________________________________
_____ entrypoint: TestWikiGroupBackend().test_user_addition_to_group_page ______

    def test_user_addition_to_group_page(self):
        """
            Test addition of a username to a large list of group members.
            """
        request = self.request
        become_trusted(request)
    
        # long list of users
        page_content = [u" * %s" % member for member in create_random_string_list()]
        create_page(request, u'UserGroup', "\n".join(page_content))
    
        new_user = create_random_string_list(length=15, count=1)[0]
        append_page(request, u'UserGroup', u' * %s' % new_user)
        user = User(request, name=new_user)
        if not user.exists():
            User(request, name=new_user, password=new_user).save()
    
        result = new_user in request.groups[u'UserGroup']
E       assert result
>       assert False

[/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:99]
________________________________________________________________________________
____ entrypoint: TestWikiGroupBackend().test_member_removed_from_group_page ____

    def test_member_removed_from_group_page(self):
        """
            Tests appending a member to a large list of group members and
            recreating the page without the member.
            """
        request = self.request
        become_trusted(request)
    
        # long list of users
        page_content = [u" * %s" % member for member in create_random_string_list()]
        page_content = "\n".join(page_content)
        create_page(request, u'UserGroup', page_content)
    
        # updates the text with the text_user
        test_user = create_random_string_list(length=15, count=1)[0]
        create_page(request, u'UserGroup', page_content + '\n * %s' % test_user)
        result = test_user in request.groups[u'UserGroup']
E       assert result
>       assert False

[/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:118]
________________________________________________________________________________
 entrypoint: TestWikiGroupBackend().test_group_page_user_addition_trivial_change 

    def test_group_page_user_addition_trivial_change(self):
        """
            Test addition of a user to a group page by trivial change.
            """
        request = self.request
        become_trusted(request)
    
        test_user = create_random_string_list(length=15, count=1)[0]
        member = u" * %s\n" % test_user
        page = create_page(request, u'UserGroup', member)
    
        # next member saved  as trivial change
        test_user = create_random_string_list(length=15, count=1)[0]
        member = u" * %s\n" % test_user
        page = create_page(request, u'UserGroup', member)
    
        result = test_user in request.groups[u'UserGroup']
    
E       assert result
>       assert False

[/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:143]
________________________________________________________________________________
__ entrypoint: TestWikiGroupBackend().test_wiki_backend_page_acl_append_page ___

    def test_wiki_backend_page_acl_append_page(self):
        """
            Test if the wiki group backend works with acl code.
            First check acl rights of a user that is not a member of group
            then add user member to a page group and check acl rights
            """
        request = self.request
        become_trusted(request)
    
        create_page(request, u'NewGroup', u" * ExampleUser")
    
        acl_rights = ["NewGroup:read,write"]
        acl = security.AccessControlList(request.cfg, acl_rights)
    
        has_rights_before = acl.may(request, u"AnotherUser", "read")
    
        # update page - add AnotherUser to a page group NewGroup
        append_page(request, u'NewGroup', u" * AnotherUser")
    
        has_rights_after = acl.may(request, u"AnotherUser", "read")
    
        assert not has_rights_before, 'AnotherUser has no read rights because in the beginning he is not a member of a group page NewGroup'
E       assert has_rights_after, 'AnotherUser must have read rights because after appendage he is member of NewGroup'
>       AssertionError: AnotherUser must have read rights because after appendage he is member of NewGroup

[/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:167]
________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[0] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [0]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[1] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: quite_normal

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[2] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: quite_normal

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[3] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_0

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[4] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [4]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[5] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: äöüßłóąćółąńśćżź

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[6] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: äöüßłóąćółąńśćżź

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[7] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_1

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[8] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [8]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[9] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: with space

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[10] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: with space

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[11] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_2

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[12] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [12]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[13] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: name#special(characters?.\,

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[14] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: name#special(characters?.\,

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[15] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_3

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[16] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [16]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[17] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_ending_1

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[18] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_ending_1

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[19] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_4

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[20] 

    def create_rev_item(name):
        item = self.backend.create_item(name)
        assert item.name == name
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [20]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[21] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_ending_2

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[22] 

    def rename_item_check(self, old_name, new_name):
>       item = self.backend.get_item(old_name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_very_long_name_ending_2

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[23] 

    def get_item_check(self, name):
>       item = self.backend.get_item(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def get_item(self, itemname):
        """
            Return an Item with given name.
            Raise NoSuchItemError if Item does not exist.
            """
        id = self._hash(itemname)
        try:
            self._repo.changectx('')[id]
        except LookupError:
            if not self._has_meta(id):
E               raise NoSuchItemError('Item does not exist: %s' % itemname)
>               NoSuchItemError: Item does not exist: renamed_revitem_5

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_rename_to_existing 

    def test_item_rename_to_existing(self):
>       item1 = self.create_rev_item_helper("fresh_item")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:107]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - -  test_item_rename_to_existing: recorded stderr - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_rename_threesome 

    def test_item_rename_threesome(self):
>       item1 = self.create_rev_item_helper("item1")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:120]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - -  test_item_rename_threesome: recorded stderr - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
___ entrypoint: test_backends_hg.py TestMercurialBackend().test_create_order ___

    def test_create_order(self):
        item1 = self.backend.create_item('1')
        item2 = self.backend.create_item('2')
        revision1 = item1.create_revision(0)
        revision2 = item2.create_revision(0)
        revision1.write('1')
        revision2.write('2')
>       item2.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:142]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_create_order: recorded stderr - - - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_rev_item_again 

    def test_create_rev_item_again(self):
>       self.create_rev_item_helper("item1")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:152]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - -  test_create_rev_item_again: recorded stderr - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
_____ entrypoint: test_backends_hg.py TestMercurialBackend().test_has_item _____

    def test_has_item(self):
>       self.create_rev_item_helper("versioned")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:163]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - -  test_has_item: recorded stderr - - - - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
__ entrypoint: test_backends_hg.py TestMercurialBackend().test_search_simple ___

    def test_search_simple(self):
        for name in ["songlist", "song lyric", "odd_SONG_item"]:
>           self.create_rev_item_helper(name)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:173]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - -  test_search_simple: recorded stderr - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
__ entrypoint: test_backends_hg.py TestMercurialBackend().test_search_better ___

    def test_search_better(self):
>       self.create_rev_item_helper('abcde')

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:182]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

________________________________________________________________________________
___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_1 ____

    def test_iteritems_1(self):
        for num in range(10, 20):
>           self.create_rev_item_helper("item_" + str(num).zfill(2))

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:200]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_iteritems_1: recorded stderr - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_2 ____

    def test_iteritems_2(self):
>       self.create_rev_item_helper('abcdefghijklmn')

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:210]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_iteritems_2: recorded stderr - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_3 ____

    def test_iteritems_3(self):
>       self.create_rev_item_helper("without_meta")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:217]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_iteritems_3: recorded stderr - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_existing_item_create_revision 

    def test_existing_item_create_revision(self):
>       self.create_rev_item_helper("existing")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:227]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - -  test_existing_item_create_revision: recorded stderr - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_commit_revision 

    def test_item_commit_revision(self):
        item = self.backend.create_item("item#11")
        rev = item.create_revision(0)
        rev.write("python rocks")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:252]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - -  test_item_commit_revision: recorded stderr - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_writing_data_multiple_times 

    def test_item_writing_data_multiple_times(self):
        item = self.backend.create_item("multiple")
        rev = item.create_revision(0)
        rev.write("Alle ")
        rev.write("meine ")
        rev.write("Entchen")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:262]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - -  test_item_writing_data_multiple_times: recorded stderr - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_reading_chunks 

    def test_item_reading_chunks(self):
        item = self.backend.create_item("slices")
        rev = item.create_revision(0)
        rev.write("Alle meine Entchen")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:270]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - -  test_item_reading_chunks: recorded stderr - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_reading_negative_chunk 

    def test_item_reading_negative_chunk(self):
        item = self.backend.create_item("negative_chunk")
        rev = item.create_revision(0)
        rev.write("Alle meine Entchen" * 10)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:283]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_item_reading_negative_chunk: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
__ entrypoint: test_backends_hg.py TestMercurialBackend().test_seek_and_tell ___

    def test_seek_and_tell(self):
        item = self.backend.create_item("seek&tell")
        rev = item.create_revision(0)
        data = "wilhelm tell seekfried what time it is"
        rev.write(data)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:294]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - -  test_seek_and_tell: recorded stderr - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_get_revision _

    def test_item_get_revision(self):
        item = self.backend.create_item("item#12")
        rev = item.create_revision(0)
        rev.write("jefferson airplane rocks")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:319]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - -  test_item_get_revision: recorded stderr - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
_ entrypoint: test_backends_hg.py TestMercurialBackend().test_item_next_revno __

    def test_item_next_revno(self):
        item = self.backend.create_item("next_revno")
        assert item.next_revno == 0
        item.create_revision(item.next_revno).write("foo")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:327]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - -  test_item_next_revno: recorded stderr - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_with_revmeta_changes 

    def test_item_list_revisions_with_revmeta_changes(self):
        item = self.backend.create_item("item_13")
        for revno in range(0, 10):
            rev = item.create_revision(revno)
            rev["revno"] = "%s" % revno
>           item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:335]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - -  test_item_list_revisions_with_revmeta_changes: recorded stderr - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_with_revdata_changes 

    def test_item_list_revisions_with_revdata_changes(self):
        item = self.backend.create_item("item_13")
        for revno in range(0, 10):
            rev = item.create_revision(revno)
            rev.write("%s" % revno)
>           item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:343]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - -  test_item_list_revisions_with_revdata_changes: recorded stderr - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_without_changes 

    def test_item_list_revisions_without_changes(self):
        item = self.backend.create_item("item_13")
        for revno in range(0, 10):
            item.create_revision(revno)
>           item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:350]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - -  test_item_list_revisions_without_changes: recorded stderr - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_equality_nonempty_revlist 

    def test_item_list_revisions_equality_nonempty_revlist(self):
        item = self.backend.create_item("new_item_16")
        rev = item.create_revision(0)
        rev.write("something interesting")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:364]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- -  test_item_list_revisions_equality_nonempty_revlist: recorded stderr - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_item_create_existing_mixed_2 

    def test_item_create_existing_mixed_2(self):
        item1 = self.backend.create_item('existing now 0')
        item1.change_metadata()
        item2 = self.backend.create_item('existing now 0')
        item2.create_revision(0)
>       item2.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:420]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_item_create_existing_mixed_2: recorded stderr - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
_____ entrypoint: test_backends_hg.py TestMercurialBackend().test_metadata _____

    def test_metadata(self):
>       self.create_rev_item_helper('no metadata')

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:446]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - -  test_metadata: recorded stderr - - - - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_revision_change_meta 

    def test_create_revision_change_meta(self):
        item = self.backend.create_item("double")
        rev = item.create_revision(0)
        rev["revno"] = "0"
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:459]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_create_revision_change_meta: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_create_revision_change_empty_meta 

    def test_create_revision_change_empty_meta(self):
        item = self.backend.create_item("double")
        rev = item.create_revision(0)
        rev["revno"] = "0"
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:472]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - -  test_create_revision_change_empty_meta: recorded stderr - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_change_meta_create_revision 

    def test_change_meta_create_revision(self):
        item = self.backend.create_item("double")
        item.change_metadata()
        item["meta"] = "data"
        item.publish_metadata()
        rev = item.create_revision(0)
        rev["revno"] = "0"
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:486]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_change_meta_create_revision: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_long_names_back_and_forth 

    def test_long_names_back_and_forth(self):
        item = self.backend.create_item("long_name_" * 100 + "with_happy_end")
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:503]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_long_names_back_and_forth: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_revisions_after_rename 

    def test_revisions_after_rename(self):
        item = self.backend.create_item("first one")
        for revno in xrange(10):
            rev = item.create_revision(revno)
            rev["revno"] = str(revno)
>           item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:513]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - -  test_revisions_after_rename: recorded stderr - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_concurrent_create_revision 

    def test_concurrent_create_revision(self):
>       self.create_rev_item_helper("concurrent")

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:529]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def create_rev_item_helper(self, name):
        item = self.backend.create_item(name)
        item.create_revision(0)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_concurrent_create_revision: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
____ entrypoint: test_backends_hg.py TestMercurialBackend().test_timestamp _____

    def test_timestamp(self):
        item = self.backend.create_item('ts1')
        rev = item.create_revision(0)
        assert rev.timestamp is None
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:541]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_timestamp: recorded stderr - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
_______ entrypoint: test_backends_hg.py TestMercurialBackend().test_size _______

    def test_size(self):
        item = self.backend.create_item('size1')
        rev = item.create_revision(0)
        rev.write('asdf')
        assert rev.size == 4
        rev.write('asdf')
        assert rev.size == 8
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:553]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - -  test_size: recorded stderr - - - - - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
______ entrypoint: test_backends_hg.py TestMercurialBackend().test_size_2 ______

    def test_size_2(self):
        item = self.backend.create_item('size2')
        rev = item.create_revision(0)
        rev.write('asdf')
        assert rev.size == 4
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:565]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - -  test_size_2: recorded stderr - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[0] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [0]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[1] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [1]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[2] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [2]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[3] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [3]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[4] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [4]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[5] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [5]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[6] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [6]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
 entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[7] 

    def test_value(value, revno):
        item = self.backend.create_item('valid_values_%s' % revno)
        rev = item.create_revision(0)
        rev["key"] = value
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - - - -  [7]: recorded stderr - - - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
_____ entrypoint: test_backends_hg.py TestMercurialBackend().test_history ______

    def test_history(self):
        order = [('first', 0, ), ('second', 0, ), ('first', 1, ), ('a', 0), ('child/my_subitem', 0) ]
        for name, revno in order:
            if revno == 0:
                item = self.backend.create_item(name)
            else:
                item = self.backend.get_item(name)
            item.create_revision(revno)
>           item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:596]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - - -  test_history: recorded stderr - - - - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
___ entrypoint: test_backends_hg.py TestMercurialBackend().test_destroy_item ___

    def test_destroy_item(self):
        itemname = "I will be completely destroyed"
        rev_data = "I will be completely destroyed, too, hopefully"
        item = self.backend.create_item(itemname)
        rev = item.create_revision(0)
        rev.write(rev_data)
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:634]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - - - -  test_destroy_item: recorded stderr - - - - - - - - - - - 
transaction abort!
rollback completed

________________________________________________________________________________
_________ entrypoint: TestMercurialBackend().test_large_revision_meta __________

    def test_large_revision_meta(self):
        item = self.backend.create_item('existing')
        rev = item.create_revision(0)
        for num in xrange(10000):
            revval = "revision metatdata value for key %d" % num
            rev["%s" % num] = revval * 10
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - -  test_large_revision_meta: recorded stderr - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
__________ entrypoint: TestMercurialBackend().test_data_after_rename ___________

    def test_data_after_rename(self):
        item = self.backend.create_item('before')
        rev = item.create_revision(0)
        rev.write("aaa")
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:96]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - - - -  test_data_after_rename: recorded stderr - - - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
______ entrypoint: TestMercurialBackend().test_revision_metadata_key_name ______

    def test_revision_metadata_key_name(self):
        item = self.backend.create_item('metakey')
        rev = item.create_revision(0)
        rev['_meta_'] = "dummy"
>       item.commit()

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:110]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self):
        """
            @see: Backend._commit_item.__doc__
            """
        assert self._uncommitted_revision is not None
>       self._backend._commit_item(self._uncommitted_revision)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commit_item(self, revision, second_parent=None):
        """
            Commit given Item Revision to repository. Update and commit Item index file.
            If Revision already exists, raise RevisionAlreadyExistsError.
            """
        item = revision.item
        lock = self._lock_repo() #XXX: lock item only!
        try:
            if not item._id:
                self._add_item(item)
            elif revision.revno in self._list_revisions(item):
                raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
    
            util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
            if revision.revno > 0:
                parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
                if second_parent:
                    parents.append(second_parent)
            else:
                self._open_item_index(item, 'wb').close()
                self._repo.add([item._id, "%s.rev" % item._id])
                parents = []
            internal_meta = {'rev': revision.revno,
                             'name': item.name,
                             'id': item._id,
                             'parents': " ".join(parents)}
            meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
            meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
    
            if not revision.timestamp:
                revision.timestamp = long(time.time())
            date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
            user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
            msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
            try:
                match = mercurial.match.exact(self._rev_path, '', [item._id])
>               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)

[/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def commit(self, files=None, text="", user=None, date=None,
               match=None, force=False, force_editor=False,
               p1=None, p2=None, extra={}, empty_ok=False):
        wlock = lock = None
        if extra.get("close"):
            force = True
        if files:
            files = util.unique(files)
        try:
            wlock = self.wlock()
            lock = self.lock()
            use_dirstate = (p1 is None) # not rawcommit
    
            if use_dirstate:
                p1, p2 = self.dirstate.parents()
                update_dirstate = True
    
                if (not force and p2 != nullid and
                    (match and (match.files() or match.anypats()))):
                    raise util.Abort(_('cannot partially commit a merge '
                                       '(do not specify files or patterns)'))
    
                if files:
                    modified, removed = [], []
                    for f in files:
                        s = self.dirstate[f]
                        if s in 'nma':
                            modified.append(f)
                        elif s == 'r':
                            removed.append(f)
                        else:
                            self.ui.warn(_("%s not tracked!\n") % f)
                    changes = [modified, [], removed, [], []]
                else:
                    changes = self.status(match=match)
            else:
                p1, p2 = p1, p2 or nullid
                update_dirstate = (self.dirstate.parents()[0] == p1)
                changes = [files, [], [], [], []]
    
            ms = merge_.mergestate(self)
            for f in changes[0]:
                if f in ms and ms[f] == 'u':
                    raise util.Abort(_("unresolved merge conflicts "
                                                    "(see hg resolve)"))
            wctx = context.workingctx(self, (p1, p2), text, user, date,
                                      extra, changes)
            r = self._commitctx(wctx, force, force_editor, empty_ok,
>                               use_dirstate, update_dirstate)

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
                  use_dirstate=True, update_dirstate=True):
        tr = None
        valid = 0 # don't save the dirstate if this isn't set
        try:
            commit = util.sort(wctx.modified() + wctx.added())
            remove = wctx.removed()
            extra = wctx.extra().copy()
            branchname = extra['branch']
            user = wctx.user()
            text = wctx.description()
    
            p1, p2 = [p.node() for p in wctx.parents()]
            c1 = self.changelog.read(p1)
            c2 = self.changelog.read(p2)
            m1 = self.manifest.read(c1[0]).copy()
            m2 = self.manifest.read(c2[0])
    
            if use_dirstate:
                oldname = c1[5].get("branch") # stored in UTF-8
                if (not commit and not remove and not force and p2 == nullid
                    and branchname == oldname):
                    self.ui.status(_("nothing changed\n"))
                    return None
    
            xp1 = hex(p1)
            if p2 == nullid: xp2 = ''
            else: xp2 = hex(p2)
    
            self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
    
            tr = self.transaction()
            trp = weakref.proxy(tr)
    
            # check in files
            new = {}
            changed = []
            linkrev = len(self)
            for f in commit:
                self.ui.note(f + "\n")
                try:
                    fctx = wctx.filectx(f)
                    newflags = fctx.flags()
                    new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
                    if ((not changed or changed[-1] != f) and
                        m2.get(f) != new[f]):
                        # mention the file in the changelog if some
                        # flag changed, even if there was no content
                        # change.
                        if m1.flags(f) != newflags:
                            changed.append(f)
                    m1.set(f, newflags)
                    if use_dirstate:
                        self.dirstate.normal(f)
    
                except (OSError, IOError):
                    if use_dirstate:
                        self.ui.warn(_("trouble committing %s!\n") % f)
                        raise
                    else:
                        remove.append(f)
    
            updated, added = [], []
            for f in util.sort(changed):
                if f in m1 or f in m2:
                    updated.append(f)
                else:
                    added.append(f)
    
            # update manifest
            m1.update(new)
            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
            removed1 = []
    
            for f in removed:
                if f in m1:
                    del m1[f]
                    removed1.append(f)
            mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
                                   (new, removed1))
    
            # add changeset
            if (not empty_ok and not text) or force_editor:
                edittext = []
                if text:
                    edittext.append(text)
                edittext.append("")
                edittext.append("") # Empty line between message and comments.
                edittext.append(_("HG: Enter commit message."
                                  "  Lines beginning with 'HG:' are removed."))
                edittext.append("HG: --")
                edittext.append("HG: user: %s" % user)
                if p2 != nullid:
                    edittext.append("HG: branch merge")
                if branchname:
                    edittext.append("HG: branch '%s'" % util.tolocal(branchname))
                edittext.extend(["HG: added %s" % f for f in added])
                edittext.extend(["HG: changed %s" % f for f in updated])
                edittext.extend(["HG: removed %s" % f for f in removed])
                if not added and not updated and not removed:
                    edittext.append("HG: no files changed")
                edittext.append("")
                # run editor in the repository root
E               olddir = os.getcwd()
>               OSError: [Errno 2] No such file or directory

[/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
- - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
"/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: --
HG: user: nobody
HG: branch 'default'
HG: added ab56b4d92b40713acc5af89985d4b786
~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               1,0-1       Alles]2;hg-editor-qpay2L.txt (/tmp) - VIM]1;hg-editor-qpay2L.txt[?12l[?25h[?1l>[?1049lVim: Fehler beim Lesen der Eingabe, Abbruch...
Vim: Beendet.
]2;Terminal - Terminal]1;Terminal - Terminal
- - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
Vim: Warnung: Die Eingabe kommt nicht von einem Terminal

transaction abort!
rollback completed
transaction abort!
rollback completed

- - - - - - -  test_revision_metadata_key_name: recorded stderr - - - - - - - -
transaction abort!
rollback completed

________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
_________________________________ entrypoint:  _________________________________

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:84]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def run(self, colitem): 
        if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
            return 
        if isinstance(colitem, py.test.collect.Item): 
            colitem._skipbykeyword(self.config.option.keyword)
        res = colitem.run() 
        if res is None: 
            return Passed() 
        elif not isinstance(res, (list, tuple)): 
            raise TypeError("%r.run() returned neither "
                            "list, tuple nor None: %r" % (colitem, res))
        else: 
            finish = self.startiteration(colitem, res)
            try: 
                for name in res: 
                    obj = colitem.join(name) 
                    assert obj is not None 
>                   self.runtraced(obj) 

[/usr/lib/python2.6/dist-packages/py/test/session.py:119]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 
    
        outcome = None 
        colitem.startcapture() 
        try: 
>           self.start(colitem)

[/usr/lib/python2.6/dist-packages/py/test/session.py:79]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start(self, colitem):
        super(TerminalSession, self).start(colitem) 
        if self.config.option.collectonly: 
            cols = self._opencollectors
            self.out.line('    ' * len(cols) + repr(colitem))
            cols.append(colitem) 
        else: 
            cls = getattr(colitem, '__class__', None)
            if cls is None:
                return
            for typ in py.std.inspect.getmro(cls):
                meth = getattr(self, 'start_%s' % typ.__name__, None)
                if meth:
>                   meth(colitem)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def start_Module(self, colitem): 
        if self.config.option.verbose == 0: 
>           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)

[/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def __new__(cls, path=None):
        """ Initialize and return a local Path instance.
    
            Path can be relative to the current directory.
            If it is None then the current working directory is taken.
            Note that Path instances always carry an absolute path.
            Note also that passing in a local path object will simply return
            the exact same path object. Use new() to get a new copy.
            """
        if isinstance(path, common.FSPathBase):
            if path.__class__ == cls:
                return path
            path = path.strpath
        # initialize the path
        self = object.__new__(cls)
        if not path:
            self.strpath = os.getcwd()
        elif isinstance(path, str):
>           self.strpath = os.path.abspath(os.path.normpath(str(path)))

[/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def abspath(path):
        """Return an absolute path."""
        if not isabs(path):
E           path = join(os.getcwd(), path)
>           OSError: [Errno 2] No such file or directory

[/usr/lib/python2.6/posixpath.py:337]
________________________________________________________________________________
===== tests finished: 1228 passed, 84 failed, 83 skipped in 31.29 seconds ======