Attachment 'output.txt'

Download

   1 ============================= test process starts ==============================
   2 executable:   /usr/bin/python  (2.6.2-final-0)
   3 using py lib: /usr/lib/python2.6/dist-packages/py <rev unknown>
   4 
   5 MoinMoin/_tests/test_Page.py - skipped
   6 MoinMoin/_tests/test_PageEditor.py - skipped
   7 MoinMoin/_tests/test_caching.py[7] .......
   8 MoinMoin/_tests/test_error.py[4] ....
   9 MoinMoin/_tests/test_packages.py - skipped
  10 MoinMoin/_tests/test_sourcecode.py[129] .....................................................................................F...........................................
  11 MoinMoin/_tests/test_test_environ.py[4] ....
  12 MoinMoin/_tests/test_user.py[14] ..............
  13 MoinMoin/_tests/test_wikisync.py - skipped
  14 MoinMoin/_tests/test_wikiutil.py[174] ..............................................................................................................................................................................
  15 MoinMoin/_tests/test_wsgiapp.py[6] ......
  16 MoinMoin/auth/_tests/test_auth.py - skipped
  17 MoinMoin/auth/_tests/test_ldap_login.py - skipped
  18 MoinMoin/config/_tests/test_configs.py[1] .
  19 MoinMoin/config/_tests/test_multiconfig.py[1] .
  20 MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py[94] ..ss........ssss...ssssssssssssssssss.s.s...ssssssssssssssssssssssssssssssssss................
  21 MoinMoin/datastruct/backends/_tests/test_composite_dicts.py[3] ...
  22 MoinMoin/datastruct/backends/_tests/test_composite_groups.py[13] .............
  23 MoinMoin/datastruct/backends/_tests/test_config_dicts.py[3] ...
  24 MoinMoin/datastruct/backends/_tests/test_config_groups.py[9] .........
  25 MoinMoin/datastruct/backends/_tests/test_lazy_config_groups.py[27] ..........F................
  26 MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py[3] ...
  27 MoinMoin/datastruct/backends/_tests/test_wiki_groups.py[16] ............FFFF
  28 MoinMoin/events/_tests/test_events.py - skipped
  29 MoinMoin/filter/_tests/test_filter.py[4] ....
  30 MoinMoin/formatter/_tests/test_formatter.py[156] ss..........................................................................................................................................................
  31 MoinMoin/formatter/_tests/test_groups.py[18] .........sssssssss
  32 MoinMoin/items/_tests/test_Item.py[4] ....
  33 MoinMoin/macro/_tests/test_FootNote.py[1] .
  34 MoinMoin/macro/_tests/test_GetVal.py - skipped
  35 MoinMoin/macro/_tests/test_PageHits.py[1] .
  36 MoinMoin/macro/_tests/test_macro.py[1] .
  37 MoinMoin/mail/_tests/test_sendmail.py[9] .........
  38 MoinMoin/parser/_tests/test_text_creole.py[25] .........................
  39 MoinMoin/parser/_tests/test_text_csv.py[3] ...
  40 MoinMoin/parser/_tests/test_text_moin_wiki.py[39] ........s..............................
  41 MoinMoin/parser/_tests/test_unicode.py[1] .
  42 MoinMoin/search/_tests/test_search.py[14] ............s.
  43 MoinMoin/search/_tests/test_terms.py[186] ..........................................................................................................................................................................................
  44 MoinMoin/security/_tests/test_security.py[148] ....................................................................................................................................................
  45 MoinMoin/storage/_tests/test_backends.py[0] 
  46 MoinMoin/storage/_tests/test_backends_flatfile.py - skipped
  47 MoinMoin/storage/_tests/test_backends_fs.py[122] ..........................................................................................................................
  48 MoinMoin/storage/_tests/test_backends_fs19.py[16] ................
  49 MoinMoin/storage/_tests/test_backends_hg.py[121] FFFFFFFFFFFFFFFFFFFFFFFF........................F....F....FF..F.FFFFF.FFFFFFFFFF.F.......F..F.FFF.FFFFFFFFFFFFFFFF...FFFs
  50 
  51 
  52 __________________________ reasons for skipped tests ___________________________
  53 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:725
  54 reason: Skipped: 'Broken.'
  55 
  56 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/parser/_tests/test_text_moin_wiki.py:213
  57 reason: Skipped: 'Broken'
  58 
  59 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_wikisync.py:10
  60 reason: Skipped: 'Broken, tests and wikisync code need item refactoring.'
  61 
  62 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/auth/_tests/test_ldap_login.py:10
  63 reason: Skipped: 'Broken due to test Config refactoring'
  64 
  65 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/auth/_tests/test_auth.py:133
  66 reason: Skipped: 'We currently have no http auth code in moin. GivenAuth relies on the web server doing the http auth check.'
  67 
  68 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_formatter.py:29
  69 reason: Skipped: 'docbook is broken'
  70 
  71 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_formatter.py:17
  72 reason: Skipped: 'domxml <p> generation is broken'
  73 
  74 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1158
  75 reason: Skipped: 'xml.dom.ext module is not available'
  76 
  77 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_packages.py:15
  78 reason: Skipped: 'Broken. Needs AttachFile/Page -> Item refactoring.'
  79 
  80 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_PageEditor.py:11
  81 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_Page.py:10
  82 reason: Skipped: 'Broken. Needs Page -> Item refactoring.'
  83 
  84 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/formatter/_tests/test_groups.py:124
  85 reason: Skipped: 'Currently broken, misses Page -> Item refactoring and/or correct format detection.'
  86 
  87 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_flatfile.py:11
  88 reason: Skipped: 'BackendTest base class tests quite some stuff that this very simple backend does not provide'
  89 
  90 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:116
  91 reason: Skipped: 'expected to fail'
  92 
  93 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/search/_tests/test_search.py:119
  94 reason: Skipped: "Won't work before Xapian code is refactored and adjusted to work with new storage"
  95 
  96 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/macro/_tests/test_GetVal.py:11
  97 reason: Skipped: 'Broken. Needs Page->Item refactoring.'
  98 
  99 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/events/_tests/test_events.py:10
 100 reason: Skipped: 'Needs Page -> Item refactoring. MoinMoin.items needs to call event code.'
 101 
 102 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1051
 103 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1045
 104 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1174
 105 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:317
 106 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:257
 107 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:486
 108 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:104
 109 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:564
 110 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:592
 111 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:465
 112 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:507
 113 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:877
 114 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:858
 115 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:279
 116 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1081
 117 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:547
 118 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1015
 119 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:445
 120 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:679
 121 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:660
 122 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1027
 123 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:115
 124 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1105
 125 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1039
 126 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:764
 127 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:945
 128 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:603
 129 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:973
 130 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:404
 131 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1184
 132 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:643
 133 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:896
 134 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1003
 135 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:424
 136 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1133
 137 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:628
 138 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1139
 139 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:614
 140 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:528
 141 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:581
 142 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1111
 143 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1069
 144 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1063
 145 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1093
 146 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1145
 147 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:694
 148 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:917
 149 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1087
 150 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1057
 151 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1099
 152 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1021
 153 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:298
 154 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1033
 155 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1075
 156 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:847
 157 Skipped in /home/user/workspace/moin-2.0-storage/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py:1009
 158 reason: Skipped: 'broken test'
 159 
 160 ________________________________________________________________________________
 161 _______________________ entrypoint: test_sourcecode[85] ________________________
 162 
 163     def check_py_file(reldir, path, mtime):
 164         if TRAILING_SPACES == 'fix':
 165             f = file(path, 'rb')
 166             data = f.read()
 167             f.close()
 168             fixed = FIX_TS_RE.sub('', data)
 169     
 170             # Don't write files if there's no need for that,
 171             # as altering timestamps can be annoying with some tools.
 172             if fixed == data:
 173                 return
 174     
 175             f = file(path, 'wb')
 176             f.write(fixed)
 177             f.close()
 178         # Please read and follow PEP8 - rerun this test until it does not fail any more,
 179         # any type of error is only reported ONCE (even if there are multiple).
 180         error_count = pep8_error_count(path)
 181 E       assert error_count == 0
 182 >       assert 1 == 0
 183 
 184 [/home/user/workspace/moin-2.0-storage/MoinMoin/_tests/test_sourcecode.py:95]
 185 - - - - - - - - - - - - - -  [85]: recorded stdout - - - - - - - - - - - - - - -
 186 /home/user/workspace/moin-2.0-storage/MoinMoin/script/migration/backend.py:67:1: W291 trailing whitespace
 187 
 188 ^
 189 
 190 ________________________________________________________________________________
 191 ___ entrypoint: test_lazy_config_groups.py TestLazyConfigGroups().test_iter ____
 192 
 193     def test_iter(self):
 194         groups = self.request.groups
 195     
 196         for group, members in self.expanded_groups.iteritems():
 197             returned_members = list(groups[group])
 198 E           assert len(returned_members) == len(members)
 199 >           assert 5 == 3
 200              +  where 5 = len([u'John', u'JoeDoe', u'Editor1', u'Admin1', u'Admin2'])
 201              +  and   3 = len([u'John', u'JoeDoe', u'Editor1'])
 202 
 203 [/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/__init__.py:65]
 204 ________________________________________________________________________________
 205 _____ entrypoint: TestWikiGroupBackend().test_user_addition_to_group_page ______
 206 
 207     def test_user_addition_to_group_page(self):
 208         """
 209             Test addition of a username to a large list of group members.
 210             """
 211         request = self.request
 212         become_trusted(request)
 213     
 214         # long list of users
 215         page_content = [u" * %s" % member for member in create_random_string_list()]
 216         create_page(request, u'UserGroup', "\n".join(page_content))
 217     
 218         new_user = create_random_string_list(length=15, count=1)[0]
 219         append_page(request, u'UserGroup', u' * %s' % new_user)
 220         user = User(request, name=new_user)
 221         if not user.exists():
 222             User(request, name=new_user, password=new_user).save()
 223     
 224         result = new_user in request.groups[u'UserGroup']
 225 E       assert result
 226 >       assert False
 227 
 228 [/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:99]
 229 ________________________________________________________________________________
 230 ____ entrypoint: TestWikiGroupBackend().test_member_removed_from_group_page ____
 231 
 232     def test_member_removed_from_group_page(self):
 233         """
 234             Tests appending a member to a large list of group members and
 235             recreating the page without the member.
 236             """
 237         request = self.request
 238         become_trusted(request)
 239     
 240         # long list of users
 241         page_content = [u" * %s" % member for member in create_random_string_list()]
 242         page_content = "\n".join(page_content)
 243         create_page(request, u'UserGroup', page_content)
 244     
 245         # updates the text with the text_user
 246         test_user = create_random_string_list(length=15, count=1)[0]
 247         create_page(request, u'UserGroup', page_content + '\n * %s' % test_user)
 248         result = test_user in request.groups[u'UserGroup']
 249 E       assert result
 250 >       assert False
 251 
 252 [/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:118]
 253 ________________________________________________________________________________
 254  entrypoint: TestWikiGroupBackend().test_group_page_user_addition_trivial_change 
 255 
 256     def test_group_page_user_addition_trivial_change(self):
 257         """
 258             Test addition of a user to a group page by trivial change.
 259             """
 260         request = self.request
 261         become_trusted(request)
 262     
 263         test_user = create_random_string_list(length=15, count=1)[0]
 264         member = u" * %s\n" % test_user
 265         page = create_page(request, u'UserGroup', member)
 266     
 267         # next member saved  as trivial change
 268         test_user = create_random_string_list(length=15, count=1)[0]
 269         member = u" * %s\n" % test_user
 270         page = create_page(request, u'UserGroup', member)
 271     
 272         result = test_user in request.groups[u'UserGroup']
 273     
 274 E       assert result
 275 >       assert False
 276 
 277 [/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:143]
 278 ________________________________________________________________________________
 279 __ entrypoint: TestWikiGroupBackend().test_wiki_backend_page_acl_append_page ___
 280 
 281     def test_wiki_backend_page_acl_append_page(self):
 282         """
 283             Test if the wiki group backend works with acl code.
 284             First check acl rights of a user that is not a member of group
 285             then add user member to a page group and check acl rights
 286             """
 287         request = self.request
 288         become_trusted(request)
 289     
 290         create_page(request, u'NewGroup', u" * ExampleUser")
 291     
 292         acl_rights = ["NewGroup:read,write"]
 293         acl = security.AccessControlList(request.cfg, acl_rights)
 294     
 295         has_rights_before = acl.may(request, u"AnotherUser", "read")
 296     
 297         # update page - add AnotherUser to a page group NewGroup
 298         append_page(request, u'NewGroup', u" * AnotherUser")
 299     
 300         has_rights_after = acl.may(request, u"AnotherUser", "read")
 301     
 302         assert not has_rights_before, 'AnotherUser has no read rights because in the beginning he is not a member of a group page NewGroup'
 303 E       assert has_rights_after, 'AnotherUser must have read rights because after appendage he is member of NewGroup'
 304 >       AssertionError: AnotherUser must have read rights because after appendage he is member of NewGroup
 305 
 306 [/home/user/workspace/moin-2.0-storage/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py:167]
 307 ________________________________________________________________________________
 308  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[0] 
 309 
 310     def create_rev_item(name):
 311         item = self.backend.create_item(name)
 312         assert item.name == name
 313         item.create_revision(0)
 314 >       item.commit()
 315 
 316 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
 317 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 318 
 319     def commit(self):
 320         """
 321             @see: Backend._commit_item.__doc__
 322             """
 323         assert self._uncommitted_revision is not None
 324 >       self._backend._commit_item(self._uncommitted_revision)
 325 
 326 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
 327 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 328 
 329     def _commit_item(self, revision, second_parent=None):
 330         """
 331             Commit given Item Revision to repository. Update and commit Item index file.
 332             If Revision already exists, raise RevisionAlreadyExistsError.
 333             """
 334         item = revision.item
 335         lock = self._lock_repo() #XXX: lock item only!
 336         try:
 337             if not item._id:
 338                 self._add_item(item)
 339             elif revision.revno in self._list_revisions(item):
 340                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
 341     
 342             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
 343             if revision.revno > 0:
 344                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
 345                 if second_parent:
 346                     parents.append(second_parent)
 347             else:
 348                 self._open_item_index(item, 'wb').close()
 349                 self._repo.add([item._id, "%s.rev" % item._id])
 350                 parents = []
 351             internal_meta = {'rev': revision.revno,
 352                              'name': item.name,
 353                              'id': item._id,
 354                              'parents': " ".join(parents)}
 355             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
 356             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
 357     
 358             if not revision.timestamp:
 359                 revision.timestamp = long(time.time())
 360             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
 361             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
 362             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
 363             try:
 364                 match = mercurial.match.exact(self._rev_path, '', [item._id])
 365 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
 366 
 367 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
 368 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 369 
 370     def commit(self, files=None, text="", user=None, date=None,
 371                match=None, force=False, force_editor=False,
 372                p1=None, p2=None, extra={}, empty_ok=False):
 373         wlock = lock = None
 374         if extra.get("close"):
 375             force = True
 376         if files:
 377             files = util.unique(files)
 378         try:
 379             wlock = self.wlock()
 380             lock = self.lock()
 381             use_dirstate = (p1 is None) # not rawcommit
 382     
 383             if use_dirstate:
 384                 p1, p2 = self.dirstate.parents()
 385                 update_dirstate = True
 386     
 387                 if (not force and p2 != nullid and
 388                     (match and (match.files() or match.anypats()))):
 389                     raise util.Abort(_('cannot partially commit a merge '
 390                                        '(do not specify files or patterns)'))
 391     
 392                 if files:
 393                     modified, removed = [], []
 394                     for f in files:
 395                         s = self.dirstate[f]
 396                         if s in 'nma':
 397                             modified.append(f)
 398                         elif s == 'r':
 399                             removed.append(f)
 400                         else:
 401                             self.ui.warn(_("%s not tracked!\n") % f)
 402                     changes = [modified, [], removed, [], []]
 403                 else:
 404                     changes = self.status(match=match)
 405             else:
 406                 p1, p2 = p1, p2 or nullid
 407                 update_dirstate = (self.dirstate.parents()[0] == p1)
 408                 changes = [files, [], [], [], []]
 409     
 410             ms = merge_.mergestate(self)
 411             for f in changes[0]:
 412                 if f in ms and ms[f] == 'u':
 413                     raise util.Abort(_("unresolved merge conflicts "
 414                                                     "(see hg resolve)"))
 415             wctx = context.workingctx(self, (p1, p2), text, user, date,
 416                                       extra, changes)
 417             r = self._commitctx(wctx, force, force_editor, empty_ok,
 418 >                               use_dirstate, update_dirstate)
 419 
 420 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
 421 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 422 
 423     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
 424                   use_dirstate=True, update_dirstate=True):
 425         tr = None
 426         valid = 0 # don't save the dirstate if this isn't set
 427         try:
 428             commit = util.sort(wctx.modified() + wctx.added())
 429             remove = wctx.removed()
 430             extra = wctx.extra().copy()
 431             branchname = extra['branch']
 432             user = wctx.user()
 433             text = wctx.description()
 434     
 435             p1, p2 = [p.node() for p in wctx.parents()]
 436             c1 = self.changelog.read(p1)
 437             c2 = self.changelog.read(p2)
 438             m1 = self.manifest.read(c1[0]).copy()
 439             m2 = self.manifest.read(c2[0])
 440     
 441             if use_dirstate:
 442                 oldname = c1[5].get("branch") # stored in UTF-8
 443                 if (not commit and not remove and not force and p2 == nullid
 444                     and branchname == oldname):
 445                     self.ui.status(_("nothing changed\n"))
 446                     return None
 447     
 448             xp1 = hex(p1)
 449             if p2 == nullid: xp2 = ''
 450             else: xp2 = hex(p2)
 451     
 452             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
 453     
 454             tr = self.transaction()
 455             trp = weakref.proxy(tr)
 456     
 457             # check in files
 458             new = {}
 459             changed = []
 460             linkrev = len(self)
 461             for f in commit:
 462                 self.ui.note(f + "\n")
 463                 try:
 464                     fctx = wctx.filectx(f)
 465                     newflags = fctx.flags()
 466                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
 467                     if ((not changed or changed[-1] != f) and
 468                         m2.get(f) != new[f]):
 469                         # mention the file in the changelog if some
 470                         # flag changed, even if there was no content
 471                         # change.
 472                         if m1.flags(f) != newflags:
 473                             changed.append(f)
 474                     m1.set(f, newflags)
 475                     if use_dirstate:
 476                         self.dirstate.normal(f)
 477     
 478                 except (OSError, IOError):
 479                     if use_dirstate:
 480                         self.ui.warn(_("trouble committing %s!\n") % f)
 481                         raise
 482                     else:
 483                         remove.append(f)
 484     
 485             updated, added = [], []
 486             for f in util.sort(changed):
 487                 if f in m1 or f in m2:
 488                     updated.append(f)
 489                 else:
 490                     added.append(f)
 491     
 492             # update manifest
 493             m1.update(new)
 494             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
 495             removed1 = []
 496     
 497             for f in removed:
 498                 if f in m1:
 499                     del m1[f]
 500                     removed1.append(f)
 501             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
 502                                    (new, removed1))
 503     
 504             # add changeset
 505             if (not empty_ok and not text) or force_editor:
 506                 edittext = []
 507                 if text:
 508                     edittext.append(text)
 509                 edittext.append("")
 510                 edittext.append("") # Empty line between message and comments.
 511                 edittext.append(_("HG: Enter commit message."
 512                                   "  Lines beginning with 'HG:' are removed."))
 513                 edittext.append("HG: --")
 514                 edittext.append("HG: user: %s" % user)
 515                 if p2 != nullid:
 516                     edittext.append("HG: branch merge")
 517                 if branchname:
 518                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
 519                 edittext.extend(["HG: added %s" % f for f in added])
 520                 edittext.extend(["HG: changed %s" % f for f in updated])
 521                 edittext.extend(["HG: removed %s" % f for f in removed])
 522                 if not added and not updated and not removed:
 523                     edittext.append("HG: no files changed")
 524                 edittext.append("")
 525                 # run editor in the repository root
 526 E               olddir = os.getcwd()
 527 >               OSError: [Errno 2] No such file or directory
 528 
 529 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
 530 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 531 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 532 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 533 HG: --
 534 HG: user: nobody
 535 HG: branch 'default'
 536 HG: added ab56b4d92b40713acc5af89985d4b786
 537 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 538 Vim: Beendet.
 539 ]2;Terminal - Terminal]1;Terminal - Terminal
 540 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 541 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 542 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 543 
 544 transaction abort!
 545 rollback completed
 546 transaction abort!
 547 rollback completed
 548 
 549 - - - - - - - - - - - - - -  [0]: recorded stderr - - - - - - - - - - - - - - -
 550 transaction abort!
 551 rollback completed
 552 
 553 ________________________________________________________________________________
 554  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[1] 
 555 
 556     def get_item_check(self, name):
 557 >       item = self.backend.get_item(name)
 558 
 559 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
 560 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 561 
 562     def get_item(self, itemname):
 563         """
 564             Return an Item with given name.
 565             Raise NoSuchItemError if Item does not exist.
 566             """
 567         id = self._hash(itemname)
 568         try:
 569             self._repo.changectx('')[id]
 570         except LookupError:
 571             if not self._has_meta(id):
 572 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
 573 >               NoSuchItemError: Item does not exist: quite_normal
 574 
 575 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
 576 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 577 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 578 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 579 HG: --
 580 HG: user: nobody
 581 HG: branch 'default'
 582 HG: added ab56b4d92b40713acc5af89985d4b786
 583 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 584 Vim: Beendet.
 585 ]2;Terminal - Terminal]1;Terminal - Terminal
 586 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 587 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 588 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 589 
 590 transaction abort!
 591 rollback completed
 592 transaction abort!
 593 rollback completed
 594 
 595 ________________________________________________________________________________
 596  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[2] 
 597 
 598     def rename_item_check(self, old_name, new_name):
 599 >       item = self.backend.get_item(old_name)
 600 
 601 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
 602 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 603 
 604     def get_item(self, itemname):
 605         """
 606             Return an Item with given name.
 607             Raise NoSuchItemError if Item does not exist.
 608             """
 609         id = self._hash(itemname)
 610         try:
 611             self._repo.changectx('')[id]
 612         except LookupError:
 613             if not self._has_meta(id):
 614 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
 615 >               NoSuchItemError: Item does not exist: quite_normal
 616 
 617 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
 618 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 619 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 620 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 621 HG: --
 622 HG: user: nobody
 623 HG: branch 'default'
 624 HG: added ab56b4d92b40713acc5af89985d4b786
 625 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 626 Vim: Beendet.
 627 ]2;Terminal - Terminal]1;Terminal - Terminal
 628 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 629 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 630 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 631 
 632 transaction abort!
 633 rollback completed
 634 transaction abort!
 635 rollback completed
 636 
 637 ________________________________________________________________________________
 638  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[3] 
 639 
 640     def get_item_check(self, name):
 641 >       item = self.backend.get_item(name)
 642 
 643 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
 644 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 645 
 646     def get_item(self, itemname):
 647         """
 648             Return an Item with given name.
 649             Raise NoSuchItemError if Item does not exist.
 650             """
 651         id = self._hash(itemname)
 652         try:
 653             self._repo.changectx('')[id]
 654         except LookupError:
 655             if not self._has_meta(id):
 656 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
 657 >               NoSuchItemError: Item does not exist: renamed_revitem_0
 658 
 659 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
 660 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 661 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 662 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 663 HG: --
 664 HG: user: nobody
 665 HG: branch 'default'
 666 HG: added ab56b4d92b40713acc5af89985d4b786
 667 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 668 Vim: Beendet.
 669 ]2;Terminal - Terminal]1;Terminal - Terminal
 670 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 671 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 672 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 673 
 674 transaction abort!
 675 rollback completed
 676 transaction abort!
 677 rollback completed
 678 
 679 ________________________________________________________________________________
 680  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[4] 
 681 
 682     def create_rev_item(name):
 683         item = self.backend.create_item(name)
 684         assert item.name == name
 685         item.create_revision(0)
 686 >       item.commit()
 687 
 688 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
 689 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 690 
 691     def commit(self):
 692         """
 693             @see: Backend._commit_item.__doc__
 694             """
 695         assert self._uncommitted_revision is not None
 696 >       self._backend._commit_item(self._uncommitted_revision)
 697 
 698 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
 699 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 700 
 701     def _commit_item(self, revision, second_parent=None):
 702         """
 703             Commit given Item Revision to repository. Update and commit Item index file.
 704             If Revision already exists, raise RevisionAlreadyExistsError.
 705             """
 706         item = revision.item
 707         lock = self._lock_repo() #XXX: lock item only!
 708         try:
 709             if not item._id:
 710                 self._add_item(item)
 711             elif revision.revno in self._list_revisions(item):
 712                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
 713     
 714             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
 715             if revision.revno > 0:
 716                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
 717                 if second_parent:
 718                     parents.append(second_parent)
 719             else:
 720                 self._open_item_index(item, 'wb').close()
 721                 self._repo.add([item._id, "%s.rev" % item._id])
 722                 parents = []
 723             internal_meta = {'rev': revision.revno,
 724                              'name': item.name,
 725                              'id': item._id,
 726                              'parents': " ".join(parents)}
 727             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
 728             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
 729     
 730             if not revision.timestamp:
 731                 revision.timestamp = long(time.time())
 732             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
 733             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
 734             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
 735             try:
 736                 match = mercurial.match.exact(self._rev_path, '', [item._id])
 737 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
 738 
 739 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
 740 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 741 
 742     def commit(self, files=None, text="", user=None, date=None,
 743                match=None, force=False, force_editor=False,
 744                p1=None, p2=None, extra={}, empty_ok=False):
 745         wlock = lock = None
 746         if extra.get("close"):
 747             force = True
 748         if files:
 749             files = util.unique(files)
 750         try:
 751             wlock = self.wlock()
 752             lock = self.lock()
 753             use_dirstate = (p1 is None) # not rawcommit
 754     
 755             if use_dirstate:
 756                 p1, p2 = self.dirstate.parents()
 757                 update_dirstate = True
 758     
 759                 if (not force and p2 != nullid and
 760                     (match and (match.files() or match.anypats()))):
 761                     raise util.Abort(_('cannot partially commit a merge '
 762                                        '(do not specify files or patterns)'))
 763     
 764                 if files:
 765                     modified, removed = [], []
 766                     for f in files:
 767                         s = self.dirstate[f]
 768                         if s in 'nma':
 769                             modified.append(f)
 770                         elif s == 'r':
 771                             removed.append(f)
 772                         else:
 773                             self.ui.warn(_("%s not tracked!\n") % f)
 774                     changes = [modified, [], removed, [], []]
 775                 else:
 776                     changes = self.status(match=match)
 777             else:
 778                 p1, p2 = p1, p2 or nullid
 779                 update_dirstate = (self.dirstate.parents()[0] == p1)
 780                 changes = [files, [], [], [], []]
 781     
 782             ms = merge_.mergestate(self)
 783             for f in changes[0]:
 784                 if f in ms and ms[f] == 'u':
 785                     raise util.Abort(_("unresolved merge conflicts "
 786                                                     "(see hg resolve)"))
 787             wctx = context.workingctx(self, (p1, p2), text, user, date,
 788                                       extra, changes)
 789             r = self._commitctx(wctx, force, force_editor, empty_ok,
 790 >                               use_dirstate, update_dirstate)
 791 
 792 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
 793 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 794 
 795     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
 796                   use_dirstate=True, update_dirstate=True):
 797         tr = None
 798         valid = 0 # don't save the dirstate if this isn't set
 799         try:
 800             commit = util.sort(wctx.modified() + wctx.added())
 801             remove = wctx.removed()
 802             extra = wctx.extra().copy()
 803             branchname = extra['branch']
 804             user = wctx.user()
 805             text = wctx.description()
 806     
 807             p1, p2 = [p.node() for p in wctx.parents()]
 808             c1 = self.changelog.read(p1)
 809             c2 = self.changelog.read(p2)
 810             m1 = self.manifest.read(c1[0]).copy()
 811             m2 = self.manifest.read(c2[0])
 812     
 813             if use_dirstate:
 814                 oldname = c1[5].get("branch") # stored in UTF-8
 815                 if (not commit and not remove and not force and p2 == nullid
 816                     and branchname == oldname):
 817                     self.ui.status(_("nothing changed\n"))
 818                     return None
 819     
 820             xp1 = hex(p1)
 821             if p2 == nullid: xp2 = ''
 822             else: xp2 = hex(p2)
 823     
 824             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
 825     
 826             tr = self.transaction()
 827             trp = weakref.proxy(tr)
 828     
 829             # check in files
 830             new = {}
 831             changed = []
 832             linkrev = len(self)
 833             for f in commit:
 834                 self.ui.note(f + "\n")
 835                 try:
 836                     fctx = wctx.filectx(f)
 837                     newflags = fctx.flags()
 838                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
 839                     if ((not changed or changed[-1] != f) and
 840                         m2.get(f) != new[f]):
 841                         # mention the file in the changelog if some
 842                         # flag changed, even if there was no content
 843                         # change.
 844                         if m1.flags(f) != newflags:
 845                             changed.append(f)
 846                     m1.set(f, newflags)
 847                     if use_dirstate:
 848                         self.dirstate.normal(f)
 849     
 850                 except (OSError, IOError):
 851                     if use_dirstate:
 852                         self.ui.warn(_("trouble committing %s!\n") % f)
 853                         raise
 854                     else:
 855                         remove.append(f)
 856     
 857             updated, added = [], []
 858             for f in util.sort(changed):
 859                 if f in m1 or f in m2:
 860                     updated.append(f)
 861                 else:
 862                     added.append(f)
 863     
 864             # update manifest
 865             m1.update(new)
 866             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
 867             removed1 = []
 868     
 869             for f in removed:
 870                 if f in m1:
 871                     del m1[f]
 872                     removed1.append(f)
 873             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
 874                                    (new, removed1))
 875     
 876             # add changeset
 877             if (not empty_ok and not text) or force_editor:
 878                 edittext = []
 879                 if text:
 880                     edittext.append(text)
 881                 edittext.append("")
 882                 edittext.append("") # Empty line between message and comments.
 883                 edittext.append(_("HG: Enter commit message."
 884                                   "  Lines beginning with 'HG:' are removed."))
 885                 edittext.append("HG: --")
 886                 edittext.append("HG: user: %s" % user)
 887                 if p2 != nullid:
 888                     edittext.append("HG: branch merge")
 889                 if branchname:
 890                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
 891                 edittext.extend(["HG: added %s" % f for f in added])
 892                 edittext.extend(["HG: changed %s" % f for f in updated])
 893                 edittext.extend(["HG: removed %s" % f for f in removed])
 894                 if not added and not updated and not removed:
 895                     edittext.append("HG: no files changed")
 896                 edittext.append("")
 897                 # run editor in the repository root
 898 E               olddir = os.getcwd()
 899 >               OSError: [Errno 2] No such file or directory
 900 
 901 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
 902 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 903 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 904 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 905 HG: --
 906 HG: user: nobody
 907 HG: branch 'default'
 908 HG: added ab56b4d92b40713acc5af89985d4b786
 909 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 910 Vim: Beendet.
 911 ]2;Terminal - Terminal]1;Terminal - Terminal
 912 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 913 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 914 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 915 
 916 transaction abort!
 917 rollback completed
 918 transaction abort!
 919 rollback completed
 920 
 921 - - - - - - - - - - - - - -  [4]: recorded stderr - - - - - - - - - - - - - - -
 922 transaction abort!
 923 rollback completed
 924 
 925 ________________________________________________________________________________
 926  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[5] 
 927 
 928     def get_item_check(self, name):
 929 >       item = self.backend.get_item(name)
 930 
 931 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
 932 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 933 
 934     def get_item(self, itemname):
 935         """
 936             Return an Item with given name.
 937             Raise NoSuchItemError if Item does not exist.
 938             """
 939         id = self._hash(itemname)
 940         try:
 941             self._repo.changectx('')[id]
 942         except LookupError:
 943             if not self._has_meta(id):
 944 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
 945 >               NoSuchItemError: Item does not exist: äöüßłóąćółąńśćżź
 946 
 947 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
 948 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 949 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 950 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 951 HG: --
 952 HG: user: nobody
 953 HG: branch 'default'
 954 HG: added ab56b4d92b40713acc5af89985d4b786
 955 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 956 Vim: Beendet.
 957 ]2;Terminal - Terminal]1;Terminal - Terminal
 958 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
 959 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
 960 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
 961 
 962 transaction abort!
 963 rollback completed
 964 transaction abort!
 965 rollback completed
 966 
 967 ________________________________________________________________________________
 968  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[6] 
 969 
 970     def rename_item_check(self, old_name, new_name):
 971 >       item = self.backend.get_item(old_name)
 972 
 973 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
 974 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 975 
 976     def get_item(self, itemname):
 977         """
 978             Return an Item with given name.
 979             Raise NoSuchItemError if Item does not exist.
 980             """
 981         id = self._hash(itemname)
 982         try:
 983             self._repo.changectx('')[id]
 984         except LookupError:
 985             if not self._has_meta(id):
 986 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
 987 >               NoSuchItemError: Item does not exist: äöüßłóąćółąńśćżź
 988 
 989 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
 990 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
 991 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
 992 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
 993 HG: --
 994 HG: user: nobody
 995 HG: branch 'default'
 996 HG: added ab56b4d92b40713acc5af89985d4b786
 997 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
 998 Vim: Beendet.
 999 ]2;Terminal - Terminal]1;Terminal - Terminal
1000 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1001 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1002 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1003 
1004 transaction abort!
1005 rollback completed
1006 transaction abort!
1007 rollback completed
1008 
1009 ________________________________________________________________________________
1010  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[7] 
1011 
1012     def get_item_check(self, name):
1013 >       item = self.backend.get_item(name)
1014 
1015 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
1016 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1017 
1018     def get_item(self, itemname):
1019         """
1020             Return an Item with given name.
1021             Raise NoSuchItemError if Item does not exist.
1022             """
1023         id = self._hash(itemname)
1024         try:
1025             self._repo.changectx('')[id]
1026         except LookupError:
1027             if not self._has_meta(id):
1028 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1029 >               NoSuchItemError: Item does not exist: renamed_revitem_1
1030 
1031 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1032 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1033 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1034 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1035 HG: --
1036 HG: user: nobody
1037 HG: branch 'default'
1038 HG: added ab56b4d92b40713acc5af89985d4b786
1039 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1040 Vim: Beendet.
1041 ]2;Terminal - Terminal]1;Terminal - Terminal
1042 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1043 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1044 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1045 
1046 transaction abort!
1047 rollback completed
1048 transaction abort!
1049 rollback completed
1050 
1051 ________________________________________________________________________________
1052  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[8] 
1053 
1054     def create_rev_item(name):
1055         item = self.backend.create_item(name)
1056         assert item.name == name
1057         item.create_revision(0)
1058 >       item.commit()
1059 
1060 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
1061 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1062 
1063     def commit(self):
1064         """
1065             @see: Backend._commit_item.__doc__
1066             """
1067         assert self._uncommitted_revision is not None
1068 >       self._backend._commit_item(self._uncommitted_revision)
1069 
1070 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
1071 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1072 
1073     def _commit_item(self, revision, second_parent=None):
1074         """
1075             Commit given Item Revision to repository. Update and commit Item index file.
1076             If Revision already exists, raise RevisionAlreadyExistsError.
1077             """
1078         item = revision.item
1079         lock = self._lock_repo() #XXX: lock item only!
1080         try:
1081             if not item._id:
1082                 self._add_item(item)
1083             elif revision.revno in self._list_revisions(item):
1084                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
1085     
1086             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
1087             if revision.revno > 0:
1088                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
1089                 if second_parent:
1090                     parents.append(second_parent)
1091             else:
1092                 self._open_item_index(item, 'wb').close()
1093                 self._repo.add([item._id, "%s.rev" % item._id])
1094                 parents = []
1095             internal_meta = {'rev': revision.revno,
1096                              'name': item.name,
1097                              'id': item._id,
1098                              'parents': " ".join(parents)}
1099             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
1100             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
1101     
1102             if not revision.timestamp:
1103                 revision.timestamp = long(time.time())
1104             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
1105             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
1106             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
1107             try:
1108                 match = mercurial.match.exact(self._rev_path, '', [item._id])
1109 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
1110 
1111 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
1112 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1113 
1114     def commit(self, files=None, text="", user=None, date=None,
1115                match=None, force=False, force_editor=False,
1116                p1=None, p2=None, extra={}, empty_ok=False):
1117         wlock = lock = None
1118         if extra.get("close"):
1119             force = True
1120         if files:
1121             files = util.unique(files)
1122         try:
1123             wlock = self.wlock()
1124             lock = self.lock()
1125             use_dirstate = (p1 is None) # not rawcommit
1126     
1127             if use_dirstate:
1128                 p1, p2 = self.dirstate.parents()
1129                 update_dirstate = True
1130     
1131                 if (not force and p2 != nullid and
1132                     (match and (match.files() or match.anypats()))):
1133                     raise util.Abort(_('cannot partially commit a merge '
1134                                        '(do not specify files or patterns)'))
1135     
1136                 if files:
1137                     modified, removed = [], []
1138                     for f in files:
1139                         s = self.dirstate[f]
1140                         if s in 'nma':
1141                             modified.append(f)
1142                         elif s == 'r':
1143                             removed.append(f)
1144                         else:
1145                             self.ui.warn(_("%s not tracked!\n") % f)
1146                     changes = [modified, [], removed, [], []]
1147                 else:
1148                     changes = self.status(match=match)
1149             else:
1150                 p1, p2 = p1, p2 or nullid
1151                 update_dirstate = (self.dirstate.parents()[0] == p1)
1152                 changes = [files, [], [], [], []]
1153     
1154             ms = merge_.mergestate(self)
1155             for f in changes[0]:
1156                 if f in ms and ms[f] == 'u':
1157                     raise util.Abort(_("unresolved merge conflicts "
1158                                                     "(see hg resolve)"))
1159             wctx = context.workingctx(self, (p1, p2), text, user, date,
1160                                       extra, changes)
1161             r = self._commitctx(wctx, force, force_editor, empty_ok,
1162 >                               use_dirstate, update_dirstate)
1163 
1164 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
1165 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1166 
1167     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
1168                   use_dirstate=True, update_dirstate=True):
1169         tr = None
1170         valid = 0 # don't save the dirstate if this isn't set
1171         try:
1172             commit = util.sort(wctx.modified() + wctx.added())
1173             remove = wctx.removed()
1174             extra = wctx.extra().copy()
1175             branchname = extra['branch']
1176             user = wctx.user()
1177             text = wctx.description()
1178     
1179             p1, p2 = [p.node() for p in wctx.parents()]
1180             c1 = self.changelog.read(p1)
1181             c2 = self.changelog.read(p2)
1182             m1 = self.manifest.read(c1[0]).copy()
1183             m2 = self.manifest.read(c2[0])
1184     
1185             if use_dirstate:
1186                 oldname = c1[5].get("branch") # stored in UTF-8
1187                 if (not commit and not remove and not force and p2 == nullid
1188                     and branchname == oldname):
1189                     self.ui.status(_("nothing changed\n"))
1190                     return None
1191     
1192             xp1 = hex(p1)
1193             if p2 == nullid: xp2 = ''
1194             else: xp2 = hex(p2)
1195     
1196             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
1197     
1198             tr = self.transaction()
1199             trp = weakref.proxy(tr)
1200     
1201             # check in files
1202             new = {}
1203             changed = []
1204             linkrev = len(self)
1205             for f in commit:
1206                 self.ui.note(f + "\n")
1207                 try:
1208                     fctx = wctx.filectx(f)
1209                     newflags = fctx.flags()
1210                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
1211                     if ((not changed or changed[-1] != f) and
1212                         m2.get(f) != new[f]):
1213                         # mention the file in the changelog if some
1214                         # flag changed, even if there was no content
1215                         # change.
1216                         if m1.flags(f) != newflags:
1217                             changed.append(f)
1218                     m1.set(f, newflags)
1219                     if use_dirstate:
1220                         self.dirstate.normal(f)
1221     
1222                 except (OSError, IOError):
1223                     if use_dirstate:
1224                         self.ui.warn(_("trouble committing %s!\n") % f)
1225                         raise
1226                     else:
1227                         remove.append(f)
1228     
1229             updated, added = [], []
1230             for f in util.sort(changed):
1231                 if f in m1 or f in m2:
1232                     updated.append(f)
1233                 else:
1234                     added.append(f)
1235     
1236             # update manifest
1237             m1.update(new)
1238             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
1239             removed1 = []
1240     
1241             for f in removed:
1242                 if f in m1:
1243                     del m1[f]
1244                     removed1.append(f)
1245             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
1246                                    (new, removed1))
1247     
1248             # add changeset
1249             if (not empty_ok and not text) or force_editor:
1250                 edittext = []
1251                 if text:
1252                     edittext.append(text)
1253                 edittext.append("")
1254                 edittext.append("") # Empty line between message and comments.
1255                 edittext.append(_("HG: Enter commit message."
1256                                   "  Lines beginning with 'HG:' are removed."))
1257                 edittext.append("HG: --")
1258                 edittext.append("HG: user: %s" % user)
1259                 if p2 != nullid:
1260                     edittext.append("HG: branch merge")
1261                 if branchname:
1262                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
1263                 edittext.extend(["HG: added %s" % f for f in added])
1264                 edittext.extend(["HG: changed %s" % f for f in updated])
1265                 edittext.extend(["HG: removed %s" % f for f in removed])
1266                 if not added and not updated and not removed:
1267                     edittext.append("HG: no files changed")
1268                 edittext.append("")
1269                 # run editor in the repository root
1270 E               olddir = os.getcwd()
1271 >               OSError: [Errno 2] No such file or directory
1272 
1273 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
1274 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1275 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1276 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1277 HG: --
1278 HG: user: nobody
1279 HG: branch 'default'
1280 HG: added ab56b4d92b40713acc5af89985d4b786
1281 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1282 Vim: Beendet.
1283 ]2;Terminal - Terminal]1;Terminal - Terminal
1284 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1285 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1286 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1287 
1288 transaction abort!
1289 rollback completed
1290 transaction abort!
1291 rollback completed
1292 
1293 - - - - - - - - - - - - - -  [8]: recorded stderr - - - - - - - - - - - - - - -
1294 transaction abort!
1295 rollback completed
1296 
1297 ________________________________________________________________________________
1298  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[9] 
1299 
1300     def get_item_check(self, name):
1301 >       item = self.backend.get_item(name)
1302 
1303 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
1304 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1305 
1306     def get_item(self, itemname):
1307         """
1308             Return an Item with given name.
1309             Raise NoSuchItemError if Item does not exist.
1310             """
1311         id = self._hash(itemname)
1312         try:
1313             self._repo.changectx('')[id]
1314         except LookupError:
1315             if not self._has_meta(id):
1316 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1317 >               NoSuchItemError: Item does not exist: with space
1318 
1319 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1320 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1321 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1322 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1323 HG: --
1324 HG: user: nobody
1325 HG: branch 'default'
1326 HG: added ab56b4d92b40713acc5af89985d4b786
1327 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1328 Vim: Beendet.
1329 ]2;Terminal - Terminal]1;Terminal - Terminal
1330 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1331 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1332 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1333 
1334 transaction abort!
1335 rollback completed
1336 transaction abort!
1337 rollback completed
1338 
1339 ________________________________________________________________________________
1340  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[10] 
1341 
1342     def rename_item_check(self, old_name, new_name):
1343 >       item = self.backend.get_item(old_name)
1344 
1345 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
1346 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1347 
1348     def get_item(self, itemname):
1349         """
1350             Return an Item with given name.
1351             Raise NoSuchItemError if Item does not exist.
1352             """
1353         id = self._hash(itemname)
1354         try:
1355             self._repo.changectx('')[id]
1356         except LookupError:
1357             if not self._has_meta(id):
1358 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1359 >               NoSuchItemError: Item does not exist: with space
1360 
1361 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1362 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1363 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1364 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1365 HG: --
1366 HG: user: nobody
1367 HG: branch 'default'
1368 HG: added ab56b4d92b40713acc5af89985d4b786
1369 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1370 Vim: Beendet.
1371 ]2;Terminal - Terminal]1;Terminal - Terminal
1372 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1373 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1374 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1375 
1376 transaction abort!
1377 rollback completed
1378 transaction abort!
1379 rollback completed
1380 
1381 ________________________________________________________________________________
1382  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[11] 
1383 
1384     def get_item_check(self, name):
1385 >       item = self.backend.get_item(name)
1386 
1387 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
1388 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1389 
1390     def get_item(self, itemname):
1391         """
1392             Return an Item with given name.
1393             Raise NoSuchItemError if Item does not exist.
1394             """
1395         id = self._hash(itemname)
1396         try:
1397             self._repo.changectx('')[id]
1398         except LookupError:
1399             if not self._has_meta(id):
1400 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1401 >               NoSuchItemError: Item does not exist: renamed_revitem_2
1402 
1403 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1404 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1405 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1406 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1407 HG: --
1408 HG: user: nobody
1409 HG: branch 'default'
1410 HG: added ab56b4d92b40713acc5af89985d4b786
1411 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1412 Vim: Beendet.
1413 ]2;Terminal - Terminal]1;Terminal - Terminal
1414 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1415 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1416 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1417 
1418 transaction abort!
1419 rollback completed
1420 transaction abort!
1421 rollback completed
1422 
1423 ________________________________________________________________________________
1424  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[12] 
1425 
1426     def create_rev_item(name):
1427         item = self.backend.create_item(name)
1428         assert item.name == name
1429         item.create_revision(0)
1430 >       item.commit()
1431 
1432 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
1433 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1434 
1435     def commit(self):
1436         """
1437             @see: Backend._commit_item.__doc__
1438             """
1439         assert self._uncommitted_revision is not None
1440 >       self._backend._commit_item(self._uncommitted_revision)
1441 
1442 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
1443 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1444 
1445     def _commit_item(self, revision, second_parent=None):
1446         """
1447             Commit given Item Revision to repository. Update and commit Item index file.
1448             If Revision already exists, raise RevisionAlreadyExistsError.
1449             """
1450         item = revision.item
1451         lock = self._lock_repo() #XXX: lock item only!
1452         try:
1453             if not item._id:
1454                 self._add_item(item)
1455             elif revision.revno in self._list_revisions(item):
1456                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
1457     
1458             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
1459             if revision.revno > 0:
1460                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
1461                 if second_parent:
1462                     parents.append(second_parent)
1463             else:
1464                 self._open_item_index(item, 'wb').close()
1465                 self._repo.add([item._id, "%s.rev" % item._id])
1466                 parents = []
1467             internal_meta = {'rev': revision.revno,
1468                              'name': item.name,
1469                              'id': item._id,
1470                              'parents': " ".join(parents)}
1471             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
1472             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
1473     
1474             if not revision.timestamp:
1475                 revision.timestamp = long(time.time())
1476             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
1477             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
1478             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
1479             try:
1480                 match = mercurial.match.exact(self._rev_path, '', [item._id])
1481 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
1482 
1483 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
1484 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1485 
1486     def commit(self, files=None, text="", user=None, date=None,
1487                match=None, force=False, force_editor=False,
1488                p1=None, p2=None, extra={}, empty_ok=False):
1489         wlock = lock = None
1490         if extra.get("close"):
1491             force = True
1492         if files:
1493             files = util.unique(files)
1494         try:
1495             wlock = self.wlock()
1496             lock = self.lock()
1497             use_dirstate = (p1 is None) # not rawcommit
1498     
1499             if use_dirstate:
1500                 p1, p2 = self.dirstate.parents()
1501                 update_dirstate = True
1502     
1503                 if (not force and p2 != nullid and
1504                     (match and (match.files() or match.anypats()))):
1505                     raise util.Abort(_('cannot partially commit a merge '
1506                                        '(do not specify files or patterns)'))
1507     
1508                 if files:
1509                     modified, removed = [], []
1510                     for f in files:
1511                         s = self.dirstate[f]
1512                         if s in 'nma':
1513                             modified.append(f)
1514                         elif s == 'r':
1515                             removed.append(f)
1516                         else:
1517                             self.ui.warn(_("%s not tracked!\n") % f)
1518                     changes = [modified, [], removed, [], []]
1519                 else:
1520                     changes = self.status(match=match)
1521             else:
1522                 p1, p2 = p1, p2 or nullid
1523                 update_dirstate = (self.dirstate.parents()[0] == p1)
1524                 changes = [files, [], [], [], []]
1525     
1526             ms = merge_.mergestate(self)
1527             for f in changes[0]:
1528                 if f in ms and ms[f] == 'u':
1529                     raise util.Abort(_("unresolved merge conflicts "
1530                                                     "(see hg resolve)"))
1531             wctx = context.workingctx(self, (p1, p2), text, user, date,
1532                                       extra, changes)
1533             r = self._commitctx(wctx, force, force_editor, empty_ok,
1534 >                               use_dirstate, update_dirstate)
1535 
1536 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
1537 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1538 
1539     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
1540                   use_dirstate=True, update_dirstate=True):
1541         tr = None
1542         valid = 0 # don't save the dirstate if this isn't set
1543         try:
1544             commit = util.sort(wctx.modified() + wctx.added())
1545             remove = wctx.removed()
1546             extra = wctx.extra().copy()
1547             branchname = extra['branch']
1548             user = wctx.user()
1549             text = wctx.description()
1550     
1551             p1, p2 = [p.node() for p in wctx.parents()]
1552             c1 = self.changelog.read(p1)
1553             c2 = self.changelog.read(p2)
1554             m1 = self.manifest.read(c1[0]).copy()
1555             m2 = self.manifest.read(c2[0])
1556     
1557             if use_dirstate:
1558                 oldname = c1[5].get("branch") # stored in UTF-8
1559                 if (not commit and not remove and not force and p2 == nullid
1560                     and branchname == oldname):
1561                     self.ui.status(_("nothing changed\n"))
1562                     return None
1563     
1564             xp1 = hex(p1)
1565             if p2 == nullid: xp2 = ''
1566             else: xp2 = hex(p2)
1567     
1568             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
1569     
1570             tr = self.transaction()
1571             trp = weakref.proxy(tr)
1572     
1573             # check in files
1574             new = {}
1575             changed = []
1576             linkrev = len(self)
1577             for f in commit:
1578                 self.ui.note(f + "\n")
1579                 try:
1580                     fctx = wctx.filectx(f)
1581                     newflags = fctx.flags()
1582                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
1583                     if ((not changed or changed[-1] != f) and
1584                         m2.get(f) != new[f]):
1585                         # mention the file in the changelog if some
1586                         # flag changed, even if there was no content
1587                         # change.
1588                         if m1.flags(f) != newflags:
1589                             changed.append(f)
1590                     m1.set(f, newflags)
1591                     if use_dirstate:
1592                         self.dirstate.normal(f)
1593     
1594                 except (OSError, IOError):
1595                     if use_dirstate:
1596                         self.ui.warn(_("trouble committing %s!\n") % f)
1597                         raise
1598                     else:
1599                         remove.append(f)
1600     
1601             updated, added = [], []
1602             for f in util.sort(changed):
1603                 if f in m1 or f in m2:
1604                     updated.append(f)
1605                 else:
1606                     added.append(f)
1607     
1608             # update manifest
1609             m1.update(new)
1610             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
1611             removed1 = []
1612     
1613             for f in removed:
1614                 if f in m1:
1615                     del m1[f]
1616                     removed1.append(f)
1617             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
1618                                    (new, removed1))
1619     
1620             # add changeset
1621             if (not empty_ok and not text) or force_editor:
1622                 edittext = []
1623                 if text:
1624                     edittext.append(text)
1625                 edittext.append("")
1626                 edittext.append("") # Empty line between message and comments.
1627                 edittext.append(_("HG: Enter commit message."
1628                                   "  Lines beginning with 'HG:' are removed."))
1629                 edittext.append("HG: --")
1630                 edittext.append("HG: user: %s" % user)
1631                 if p2 != nullid:
1632                     edittext.append("HG: branch merge")
1633                 if branchname:
1634                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
1635                 edittext.extend(["HG: added %s" % f for f in added])
1636                 edittext.extend(["HG: changed %s" % f for f in updated])
1637                 edittext.extend(["HG: removed %s" % f for f in removed])
1638                 if not added and not updated and not removed:
1639                     edittext.append("HG: no files changed")
1640                 edittext.append("")
1641                 # run editor in the repository root
1642 E               olddir = os.getcwd()
1643 >               OSError: [Errno 2] No such file or directory
1644 
1645 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
1646 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1647 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1648 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1649 HG: --
1650 HG: user: nobody
1651 HG: branch 'default'
1652 HG: added ab56b4d92b40713acc5af89985d4b786
1653 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1654 Vim: Beendet.
1655 ]2;Terminal - Terminal]1;Terminal - Terminal
1656 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1657 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1658 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1659 
1660 transaction abort!
1661 rollback completed
1662 transaction abort!
1663 rollback completed
1664 
1665 - - - - - - - - - - - - - -  [12]: recorded stderr - - - - - - - - - - - - - - -
1666 transaction abort!
1667 rollback completed
1668 
1669 ________________________________________________________________________________
1670  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[13] 
1671 
1672     def get_item_check(self, name):
1673 >       item = self.backend.get_item(name)
1674 
1675 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
1676 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1677 
1678     def get_item(self, itemname):
1679         """
1680             Return an Item with given name.
1681             Raise NoSuchItemError if Item does not exist.
1682             """
1683         id = self._hash(itemname)
1684         try:
1685             self._repo.changectx('')[id]
1686         except LookupError:
1687             if not self._has_meta(id):
1688 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1689 >               NoSuchItemError: Item does not exist: name#special(characters?.\,
1690 
1691 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1692 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1693 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1694 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1695 HG: --
1696 HG: user: nobody
1697 HG: branch 'default'
1698 HG: added ab56b4d92b40713acc5af89985d4b786
1699 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1700 Vim: Beendet.
1701 ]2;Terminal - Terminal]1;Terminal - Terminal
1702 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1703 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1704 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1705 
1706 transaction abort!
1707 rollback completed
1708 transaction abort!
1709 rollback completed
1710 
1711 ________________________________________________________________________________
1712  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[14] 
1713 
1714     def rename_item_check(self, old_name, new_name):
1715 >       item = self.backend.get_item(old_name)
1716 
1717 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
1718 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1719 
1720     def get_item(self, itemname):
1721         """
1722             Return an Item with given name.
1723             Raise NoSuchItemError if Item does not exist.
1724             """
1725         id = self._hash(itemname)
1726         try:
1727             self._repo.changectx('')[id]
1728         except LookupError:
1729             if not self._has_meta(id):
1730 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1731 >               NoSuchItemError: Item does not exist: name#special(characters?.\,
1732 
1733 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1734 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1735 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1736 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1737 HG: --
1738 HG: user: nobody
1739 HG: branch 'default'
1740 HG: added ab56b4d92b40713acc5af89985d4b786
1741 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1742 Vim: Beendet.
1743 ]2;Terminal - Terminal]1;Terminal - Terminal
1744 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1745 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1746 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1747 
1748 transaction abort!
1749 rollback completed
1750 transaction abort!
1751 rollback completed
1752 
1753 ________________________________________________________________________________
1754  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[15] 
1755 
1756     def get_item_check(self, name):
1757 >       item = self.backend.get_item(name)
1758 
1759 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
1760 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1761 
1762     def get_item(self, itemname):
1763         """
1764             Return an Item with given name.
1765             Raise NoSuchItemError if Item does not exist.
1766             """
1767         id = self._hash(itemname)
1768         try:
1769             self._repo.changectx('')[id]
1770         except LookupError:
1771             if not self._has_meta(id):
1772 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
1773 >               NoSuchItemError: Item does not exist: renamed_revitem_3
1774 
1775 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
1776 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
1777 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
1778 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
1779 HG: --
1780 HG: user: nobody
1781 HG: branch 'default'
1782 HG: added ab56b4d92b40713acc5af89985d4b786
1783 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
1784 Vim: Beendet.
1785 ]2;Terminal - Terminal]1;Terminal - Terminal
1786 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
1787 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
1788 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
1789 
1790 transaction abort!
1791 rollback completed
1792 transaction abort!
1793 rollback completed
1794 
1795 ________________________________________________________________________________
1796  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[16] 
1797 
1798     def create_rev_item(name):
1799         item = self.backend.create_item(name)
1800         assert item.name == name
1801         item.create_revision(0)
1802 >       item.commit()
1803 
1804 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
1805 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1806 
1807     def commit(self):
1808         """
1809             @see: Backend._commit_item.__doc__
1810             """
1811         assert self._uncommitted_revision is not None
1812 >       self._backend._commit_item(self._uncommitted_revision)
1813 
1814 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
1815 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1816 
1817     def _commit_item(self, revision, second_parent=None):
1818         """
1819             Commit given Item Revision to repository. Update and commit Item index file.
1820             If Revision already exists, raise RevisionAlreadyExistsError.
1821             """
1822         item = revision.item
1823         lock = self._lock_repo() #XXX: lock item only!
1824         try:
1825             if not item._id:
1826                 self._add_item(item)
1827             elif revision.revno in self._list_revisions(item):
1828                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
1829     
1830             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
1831             if revision.revno > 0:
1832                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
1833                 if second_parent:
1834                     parents.append(second_parent)
1835             else:
1836                 self._open_item_index(item, 'wb').close()
1837                 self._repo.add([item._id, "%s.rev" % item._id])
1838                 parents = []
1839             internal_meta = {'rev': revision.revno,
1840                              'name': item.name,
1841                              'id': item._id,
1842                              'parents': " ".join(parents)}
1843             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
1844             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
1845     
1846             if not revision.timestamp:
1847                 revision.timestamp = long(time.time())
1848             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
1849             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
1850             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
1851             try:
1852                 match = mercurial.match.exact(self._rev_path, '', [item._id])
1853 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
1854 
1855 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
1856 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1857 
1858     def commit(self, files=None, text="", user=None, date=None,
1859                match=None, force=False, force_editor=False,
1860                p1=None, p2=None, extra={}, empty_ok=False):
1861         wlock = lock = None
1862         if extra.get("close"):
1863             force = True
1864         if files:
1865             files = util.unique(files)
1866         try:
1867             wlock = self.wlock()
1868             lock = self.lock()
1869             use_dirstate = (p1 is None) # not rawcommit
1870     
1871             if use_dirstate:
1872                 p1, p2 = self.dirstate.parents()
1873                 update_dirstate = True
1874     
1875                 if (not force and p2 != nullid and
1876                     (match and (match.files() or match.anypats()))):
1877                     raise util.Abort(_('cannot partially commit a merge '
1878                                        '(do not specify files or patterns)'))
1879     
1880                 if files:
1881                     modified, removed = [], []
1882                     for f in files:
1883                         s = self.dirstate[f]
1884                         if s in 'nma':
1885                             modified.append(f)
1886                         elif s == 'r':
1887                             removed.append(f)
1888                         else:
1889                             self.ui.warn(_("%s not tracked!\n") % f)
1890                     changes = [modified, [], removed, [], []]
1891                 else:
1892                     changes = self.status(match=match)
1893             else:
1894                 p1, p2 = p1, p2 or nullid
1895                 update_dirstate = (self.dirstate.parents()[0] == p1)
1896                 changes = [files, [], [], [], []]
1897     
1898             ms = merge_.mergestate(self)
1899             for f in changes[0]:
1900                 if f in ms and ms[f] == 'u':
1901                     raise util.Abort(_("unresolved merge conflicts "
1902                                                     "(see hg resolve)"))
1903             wctx = context.workingctx(self, (p1, p2), text, user, date,
1904                                       extra, changes)
1905             r = self._commitctx(wctx, force, force_editor, empty_ok,
1906 >                               use_dirstate, update_dirstate)
1907 
1908 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
1909 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1910 
1911     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
1912                   use_dirstate=True, update_dirstate=True):
1913         tr = None
1914         valid = 0 # don't save the dirstate if this isn't set
1915         try:
1916             commit = util.sort(wctx.modified() + wctx.added())
1917             remove = wctx.removed()
1918             extra = wctx.extra().copy()
1919             branchname = extra['branch']
1920             user = wctx.user()
1921             text = wctx.description()
1922     
1923             p1, p2 = [p.node() for p in wctx.parents()]
1924             c1 = self.changelog.read(p1)
1925             c2 = self.changelog.read(p2)
1926             m1 = self.manifest.read(c1[0]).copy()
1927             m2 = self.manifest.read(c2[0])
1928     
1929             if use_dirstate:
1930                 oldname = c1[5].get("branch") # stored in UTF-8
1931                 if (not commit and not remove and not force and p2 == nullid
1932                     and branchname == oldname):
1933                     self.ui.status(_("nothing changed\n"))
1934                     return None
1935     
1936             xp1 = hex(p1)
1937             if p2 == nullid: xp2 = ''
1938             else: xp2 = hex(p2)
1939     
1940             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
1941     
1942             tr = self.transaction()
1943             trp = weakref.proxy(tr)
1944     
1945             # check in files
1946             new = {}
1947             changed = []
1948             linkrev = len(self)
1949             for f in commit:
1950                 self.ui.note(f + "\n")
1951                 try:
1952                     fctx = wctx.filectx(f)
1953                     newflags = fctx.flags()
1954                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
1955                     if ((not changed or changed[-1] != f) and
1956                         m2.get(f) != new[f]):
1957                         # mention the file in the changelog if some
1958                         # flag changed, even if there was no content
1959                         # change.
1960                         if m1.flags(f) != newflags:
1961                             changed.append(f)
1962                     m1.set(f, newflags)
1963                     if use_dirstate:
1964                         self.dirstate.normal(f)
1965     
1966                 except (OSError, IOError):
1967                     if use_dirstate:
1968                         self.ui.warn(_("trouble committing %s!\n") % f)
1969                         raise
1970                     else:
1971                         remove.append(f)
1972     
1973             updated, added = [], []
1974             for f in util.sort(changed):
1975                 if f in m1 or f in m2:
1976                     updated.append(f)
1977                 else:
1978                     added.append(f)
1979     
1980             # update manifest
1981             m1.update(new)
1982             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
1983             removed1 = []
1984     
1985             for f in removed:
1986                 if f in m1:
1987                     del m1[f]
1988                     removed1.append(f)
1989             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
1990                                    (new, removed1))
1991     
1992             # add changeset
1993             if (not empty_ok and not text) or force_editor:
1994                 edittext = []
1995                 if text:
1996                     edittext.append(text)
1997                 edittext.append("")
1998                 edittext.append("") # Empty line between message and comments.
1999                 edittext.append(_("HG: Enter commit message."
2000                                   "  Lines beginning with 'HG:' are removed."))
2001                 edittext.append("HG: --")
2002                 edittext.append("HG: user: %s" % user)
2003                 if p2 != nullid:
2004                     edittext.append("HG: branch merge")
2005                 if branchname:
2006                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
2007                 edittext.extend(["HG: added %s" % f for f in added])
2008                 edittext.extend(["HG: changed %s" % f for f in updated])
2009                 edittext.extend(["HG: removed %s" % f for f in removed])
2010                 if not added and not updated and not removed:
2011                     edittext.append("HG: no files changed")
2012                 edittext.append("")
2013                 # run editor in the repository root
2014 E               olddir = os.getcwd()
2015 >               OSError: [Errno 2] No such file or directory
2016 
2017 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
2018 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2019 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2020 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2021 HG: --
2022 HG: user: nobody
2023 HG: branch 'default'
2024 HG: added ab56b4d92b40713acc5af89985d4b786
2025 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2026 Vim: Beendet.
2027 ]2;Terminal - Terminal]1;Terminal - Terminal
2028 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2029 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2030 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2031 
2032 transaction abort!
2033 rollback completed
2034 transaction abort!
2035 rollback completed
2036 
2037 - - - - - - - - - - - - - -  [16]: recorded stderr - - - - - - - - - - - - - - -
2038 transaction abort!
2039 rollback completed
2040 
2041 ________________________________________________________________________________
2042  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[17] 
2043 
2044     def get_item_check(self, name):
2045 >       item = self.backend.get_item(name)
2046 
2047 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
2048 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2049 
2050     def get_item(self, itemname):
2051         """
2052             Return an Item with given name.
2053             Raise NoSuchItemError if Item does not exist.
2054             """
2055         id = self._hash(itemname)
2056         try:
2057             self._repo.changectx('')[id]
2058         except LookupError:
2059             if not self._has_meta(id):
2060 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2061 >               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
2062 
2063 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2064 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2065 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2066 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2067 HG: --
2068 HG: user: nobody
2069 HG: branch 'default'
2070 HG: added ab56b4d92b40713acc5af89985d4b786
2071 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2072 Vim: Beendet.
2073 ]2;Terminal - Terminal]1;Terminal - Terminal
2074 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2075 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2076 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2077 
2078 transaction abort!
2079 rollback completed
2080 transaction abort!
2081 rollback completed
2082 
2083 ________________________________________________________________________________
2084  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[18] 
2085 
2086     def rename_item_check(self, old_name, new_name):
2087 >       item = self.backend.get_item(old_name)
2088 
2089 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
2090 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2091 
2092     def get_item(self, itemname):
2093         """
2094             Return an Item with given name.
2095             Raise NoSuchItemError if Item does not exist.
2096             """
2097         id = self._hash(itemname)
2098         try:
2099             self._repo.changectx('')[id]
2100         except LookupError:
2101             if not self._has_meta(id):
2102 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2103 >               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
2104 
2105 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2106 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2107 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2108 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2109 HG: --
2110 HG: user: nobody
2111 HG: branch 'default'
2112 HG: added ab56b4d92b40713acc5af89985d4b786
2113 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2114 Vim: Beendet.
2115 ]2;Terminal - Terminal]1;Terminal - Terminal
2116 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2117 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2118 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2119 
2120 transaction abort!
2121 rollback completed
2122 transaction abort!
2123 rollback completed
2124 
2125 ________________________________________________________________________________
2126  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[19] 
2127 
2128     def get_item_check(self, name):
2129 >       item = self.backend.get_item(name)
2130 
2131 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
2132 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2133 
2134     def get_item(self, itemname):
2135         """
2136             Return an Item with given name.
2137             Raise NoSuchItemError if Item does not exist.
2138             """
2139         id = self._hash(itemname)
2140         try:
2141             self._repo.changectx('')[id]
2142         except LookupError:
2143             if not self._has_meta(id):
2144 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2145 >               NoSuchItemError: Item does not exist: renamed_revitem_4
2146 
2147 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2148 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2149 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2150 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2151 HG: --
2152 HG: user: nobody
2153 HG: branch 'default'
2154 HG: added ab56b4d92b40713acc5af89985d4b786
2155 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2156 Vim: Beendet.
2157 ]2;Terminal - Terminal]1;Terminal - Terminal
2158 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2159 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2160 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2161 
2162 transaction abort!
2163 rollback completed
2164 transaction abort!
2165 rollback completed
2166 
2167 ________________________________________________________________________________
2168  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[20] 
2169 
2170     def create_rev_item(name):
2171         item = self.backend.create_item(name)
2172         assert item.name == name
2173         item.create_revision(0)
2174 >       item.commit()
2175 
2176 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:81]
2177 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2178 
2179     def commit(self):
2180         """
2181             @see: Backend._commit_item.__doc__
2182             """
2183         assert self._uncommitted_revision is not None
2184 >       self._backend._commit_item(self._uncommitted_revision)
2185 
2186 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
2187 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2188 
2189     def _commit_item(self, revision, second_parent=None):
2190         """
2191             Commit given Item Revision to repository. Update and commit Item index file.
2192             If Revision already exists, raise RevisionAlreadyExistsError.
2193             """
2194         item = revision.item
2195         lock = self._lock_repo() #XXX: lock item only!
2196         try:
2197             if not item._id:
2198                 self._add_item(item)
2199             elif revision.revno in self._list_revisions(item):
2200                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
2201     
2202             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
2203             if revision.revno > 0:
2204                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
2205                 if second_parent:
2206                     parents.append(second_parent)
2207             else:
2208                 self._open_item_index(item, 'wb').close()
2209                 self._repo.add([item._id, "%s.rev" % item._id])
2210                 parents = []
2211             internal_meta = {'rev': revision.revno,
2212                              'name': item.name,
2213                              'id': item._id,
2214                              'parents': " ".join(parents)}
2215             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
2216             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
2217     
2218             if not revision.timestamp:
2219                 revision.timestamp = long(time.time())
2220             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
2221             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
2222             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
2223             try:
2224                 match = mercurial.match.exact(self._rev_path, '', [item._id])
2225 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
2226 
2227 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
2228 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2229 
2230     def commit(self, files=None, text="", user=None, date=None,
2231                match=None, force=False, force_editor=False,
2232                p1=None, p2=None, extra={}, empty_ok=False):
2233         wlock = lock = None
2234         if extra.get("close"):
2235             force = True
2236         if files:
2237             files = util.unique(files)
2238         try:
2239             wlock = self.wlock()
2240             lock = self.lock()
2241             use_dirstate = (p1 is None) # not rawcommit
2242     
2243             if use_dirstate:
2244                 p1, p2 = self.dirstate.parents()
2245                 update_dirstate = True
2246     
2247                 if (not force and p2 != nullid and
2248                     (match and (match.files() or match.anypats()))):
2249                     raise util.Abort(_('cannot partially commit a merge '
2250                                        '(do not specify files or patterns)'))
2251     
2252                 if files:
2253                     modified, removed = [], []
2254                     for f in files:
2255                         s = self.dirstate[f]
2256                         if s in 'nma':
2257                             modified.append(f)
2258                         elif s == 'r':
2259                             removed.append(f)
2260                         else:
2261                             self.ui.warn(_("%s not tracked!\n") % f)
2262                     changes = [modified, [], removed, [], []]
2263                 else:
2264                     changes = self.status(match=match)
2265             else:
2266                 p1, p2 = p1, p2 or nullid
2267                 update_dirstate = (self.dirstate.parents()[0] == p1)
2268                 changes = [files, [], [], [], []]
2269     
2270             ms = merge_.mergestate(self)
2271             for f in changes[0]:
2272                 if f in ms and ms[f] == 'u':
2273                     raise util.Abort(_("unresolved merge conflicts "
2274                                                     "(see hg resolve)"))
2275             wctx = context.workingctx(self, (p1, p2), text, user, date,
2276                                       extra, changes)
2277             r = self._commitctx(wctx, force, force_editor, empty_ok,
2278 >                               use_dirstate, update_dirstate)
2279 
2280 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
2281 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2282 
2283     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
2284                   use_dirstate=True, update_dirstate=True):
2285         tr = None
2286         valid = 0 # don't save the dirstate if this isn't set
2287         try:
2288             commit = util.sort(wctx.modified() + wctx.added())
2289             remove = wctx.removed()
2290             extra = wctx.extra().copy()
2291             branchname = extra['branch']
2292             user = wctx.user()
2293             text = wctx.description()
2294     
2295             p1, p2 = [p.node() for p in wctx.parents()]
2296             c1 = self.changelog.read(p1)
2297             c2 = self.changelog.read(p2)
2298             m1 = self.manifest.read(c1[0]).copy()
2299             m2 = self.manifest.read(c2[0])
2300     
2301             if use_dirstate:
2302                 oldname = c1[5].get("branch") # stored in UTF-8
2303                 if (not commit and not remove and not force and p2 == nullid
2304                     and branchname == oldname):
2305                     self.ui.status(_("nothing changed\n"))
2306                     return None
2307     
2308             xp1 = hex(p1)
2309             if p2 == nullid: xp2 = ''
2310             else: xp2 = hex(p2)
2311     
2312             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
2313     
2314             tr = self.transaction()
2315             trp = weakref.proxy(tr)
2316     
2317             # check in files
2318             new = {}
2319             changed = []
2320             linkrev = len(self)
2321             for f in commit:
2322                 self.ui.note(f + "\n")
2323                 try:
2324                     fctx = wctx.filectx(f)
2325                     newflags = fctx.flags()
2326                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
2327                     if ((not changed or changed[-1] != f) and
2328                         m2.get(f) != new[f]):
2329                         # mention the file in the changelog if some
2330                         # flag changed, even if there was no content
2331                         # change.
2332                         if m1.flags(f) != newflags:
2333                             changed.append(f)
2334                     m1.set(f, newflags)
2335                     if use_dirstate:
2336                         self.dirstate.normal(f)
2337     
2338                 except (OSError, IOError):
2339                     if use_dirstate:
2340                         self.ui.warn(_("trouble committing %s!\n") % f)
2341                         raise
2342                     else:
2343                         remove.append(f)
2344     
2345             updated, added = [], []
2346             for f in util.sort(changed):
2347                 if f in m1 or f in m2:
2348                     updated.append(f)
2349                 else:
2350                     added.append(f)
2351     
2352             # update manifest
2353             m1.update(new)
2354             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
2355             removed1 = []
2356     
2357             for f in removed:
2358                 if f in m1:
2359                     del m1[f]
2360                     removed1.append(f)
2361             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
2362                                    (new, removed1))
2363     
2364             # add changeset
2365             if (not empty_ok and not text) or force_editor:
2366                 edittext = []
2367                 if text:
2368                     edittext.append(text)
2369                 edittext.append("")
2370                 edittext.append("") # Empty line between message and comments.
2371                 edittext.append(_("HG: Enter commit message."
2372                                   "  Lines beginning with 'HG:' are removed."))
2373                 edittext.append("HG: --")
2374                 edittext.append("HG: user: %s" % user)
2375                 if p2 != nullid:
2376                     edittext.append("HG: branch merge")
2377                 if branchname:
2378                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
2379                 edittext.extend(["HG: added %s" % f for f in added])
2380                 edittext.extend(["HG: changed %s" % f for f in updated])
2381                 edittext.extend(["HG: removed %s" % f for f in removed])
2382                 if not added and not updated and not removed:
2383                     edittext.append("HG: no files changed")
2384                 edittext.append("")
2385                 # run editor in the repository root
2386 E               olddir = os.getcwd()
2387 >               OSError: [Errno 2] No such file or directory
2388 
2389 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
2390 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2391 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2392 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2393 HG: --
2394 HG: user: nobody
2395 HG: branch 'default'
2396 HG: added ab56b4d92b40713acc5af89985d4b786
2397 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2398 Vim: Beendet.
2399 ]2;Terminal - Terminal]1;Terminal - Terminal
2400 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2401 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2402 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2403 
2404 transaction abort!
2405 rollback completed
2406 transaction abort!
2407 rollback completed
2408 
2409 - - - - - - - - - - - - - -  [20]: recorded stderr - - - - - - - - - - - - - - -
2410 transaction abort!
2411 rollback completed
2412 
2413 ________________________________________________________________________________
2414  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[21] 
2415 
2416     def get_item_check(self, name):
2417 >       item = self.backend.get_item(name)
2418 
2419 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
2420 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2421 
2422     def get_item(self, itemname):
2423         """
2424             Return an Item with given name.
2425             Raise NoSuchItemError if Item does not exist.
2426             """
2427         id = self._hash(itemname)
2428         try:
2429             self._repo.changectx('')[id]
2430         except LookupError:
2431             if not self._has_meta(id):
2432 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2433 >               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
2434 
2435 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2436 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2437 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2438 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2439 HG: --
2440 HG: user: nobody
2441 HG: branch 'default'
2442 HG: added ab56b4d92b40713acc5af89985d4b786
2443 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2444 Vim: Beendet.
2445 ]2;Terminal - Terminal]1;Terminal - Terminal
2446 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2447 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2448 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2449 
2450 transaction abort!
2451 rollback completed
2452 transaction abort!
2453 rollback completed
2454 
2455 ________________________________________________________________________________
2456  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[22] 
2457 
2458     def rename_item_check(self, old_name, new_name):
2459 >       item = self.backend.get_item(old_name)
2460 
2461 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:70]
2462 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2463 
2464     def get_item(self, itemname):
2465         """
2466             Return an Item with given name.
2467             Raise NoSuchItemError if Item does not exist.
2468             """
2469         id = self._hash(itemname)
2470         try:
2471             self._repo.changectx('')[id]
2472         except LookupError:
2473             if not self._has_meta(id):
2474 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2475 >               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
2476 
2477 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2478 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2479 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2480 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2481 HG: --
2482 HG: user: nobody
2483 HG: branch 'default'
2484 HG: added ab56b4d92b40713acc5af89985d4b786
2485 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2486 Vim: Beendet.
2487 ]2;Terminal - Terminal]1;Terminal - Terminal
2488 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2489 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2490 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2491 
2492 transaction abort!
2493 rollback completed
2494 transaction abort!
2495 rollback completed
2496 
2497 ________________________________________________________________________________
2498  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_get_rename_get_rev_item[23] 
2499 
2500     def get_item_check(self, name):
2501 >       item = self.backend.get_item(name)
2502 
2503 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:66]
2504 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2505 
2506     def get_item(self, itemname):
2507         """
2508             Return an Item with given name.
2509             Raise NoSuchItemError if Item does not exist.
2510             """
2511         id = self._hash(itemname)
2512         try:
2513             self._repo.changectx('')[id]
2514         except LookupError:
2515             if not self._has_meta(id):
2516 E               raise NoSuchItemError('Item does not exist: %s' % itemname)
2517 >               NoSuchItemError: Item does not exist: renamed_revitem_5
2518 
2519 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:109]
2520 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2521 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2522 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2523 HG: --
2524 HG: user: nobody
2525 HG: branch 'default'
2526 HG: added ab56b4d92b40713acc5af89985d4b786
2527 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2528 Vim: Beendet.
2529 ]2;Terminal - Terminal]1;Terminal - Terminal
2530 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2531 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2532 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2533 
2534 transaction abort!
2535 rollback completed
2536 transaction abort!
2537 rollback completed
2538 
2539 ________________________________________________________________________________
2540  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_rename_to_existing 
2541 
2542     def test_item_rename_to_existing(self):
2543 >       item1 = self.create_rev_item_helper("fresh_item")
2544 
2545 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:107]
2546 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2547 
2548     def create_rev_item_helper(self, name):
2549         item = self.backend.create_item(name)
2550         item.create_revision(0)
2551 >       item.commit()
2552 
2553 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
2554 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2555 
2556     def commit(self):
2557         """
2558             @see: Backend._commit_item.__doc__
2559             """
2560         assert self._uncommitted_revision is not None
2561 >       self._backend._commit_item(self._uncommitted_revision)
2562 
2563 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
2564 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2565 
2566     def _commit_item(self, revision, second_parent=None):
2567         """
2568             Commit given Item Revision to repository. Update and commit Item index file.
2569             If Revision already exists, raise RevisionAlreadyExistsError.
2570             """
2571         item = revision.item
2572         lock = self._lock_repo() #XXX: lock item only!
2573         try:
2574             if not item._id:
2575                 self._add_item(item)
2576             elif revision.revno in self._list_revisions(item):
2577                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
2578     
2579             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
2580             if revision.revno > 0:
2581                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
2582                 if second_parent:
2583                     parents.append(second_parent)
2584             else:
2585                 self._open_item_index(item, 'wb').close()
2586                 self._repo.add([item._id, "%s.rev" % item._id])
2587                 parents = []
2588             internal_meta = {'rev': revision.revno,
2589                              'name': item.name,
2590                              'id': item._id,
2591                              'parents': " ".join(parents)}
2592             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
2593             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
2594     
2595             if not revision.timestamp:
2596                 revision.timestamp = long(time.time())
2597             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
2598             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
2599             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
2600             try:
2601                 match = mercurial.match.exact(self._rev_path, '', [item._id])
2602 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
2603 
2604 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
2605 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2606 
2607     def commit(self, files=None, text="", user=None, date=None,
2608                match=None, force=False, force_editor=False,
2609                p1=None, p2=None, extra={}, empty_ok=False):
2610         wlock = lock = None
2611         if extra.get("close"):
2612             force = True
2613         if files:
2614             files = util.unique(files)
2615         try:
2616             wlock = self.wlock()
2617             lock = self.lock()
2618             use_dirstate = (p1 is None) # not rawcommit
2619     
2620             if use_dirstate:
2621                 p1, p2 = self.dirstate.parents()
2622                 update_dirstate = True
2623     
2624                 if (not force and p2 != nullid and
2625                     (match and (match.files() or match.anypats()))):
2626                     raise util.Abort(_('cannot partially commit a merge '
2627                                        '(do not specify files or patterns)'))
2628     
2629                 if files:
2630                     modified, removed = [], []
2631                     for f in files:
2632                         s = self.dirstate[f]
2633                         if s in 'nma':
2634                             modified.append(f)
2635                         elif s == 'r':
2636                             removed.append(f)
2637                         else:
2638                             self.ui.warn(_("%s not tracked!\n") % f)
2639                     changes = [modified, [], removed, [], []]
2640                 else:
2641                     changes = self.status(match=match)
2642             else:
2643                 p1, p2 = p1, p2 or nullid
2644                 update_dirstate = (self.dirstate.parents()[0] == p1)
2645                 changes = [files, [], [], [], []]
2646     
2647             ms = merge_.mergestate(self)
2648             for f in changes[0]:
2649                 if f in ms and ms[f] == 'u':
2650                     raise util.Abort(_("unresolved merge conflicts "
2651                                                     "(see hg resolve)"))
2652             wctx = context.workingctx(self, (p1, p2), text, user, date,
2653                                       extra, changes)
2654             r = self._commitctx(wctx, force, force_editor, empty_ok,
2655 >                               use_dirstate, update_dirstate)
2656 
2657 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
2658 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2659 
2660     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
2661                   use_dirstate=True, update_dirstate=True):
2662         tr = None
2663         valid = 0 # don't save the dirstate if this isn't set
2664         try:
2665             commit = util.sort(wctx.modified() + wctx.added())
2666             remove = wctx.removed()
2667             extra = wctx.extra().copy()
2668             branchname = extra['branch']
2669             user = wctx.user()
2670             text = wctx.description()
2671     
2672             p1, p2 = [p.node() for p in wctx.parents()]
2673             c1 = self.changelog.read(p1)
2674             c2 = self.changelog.read(p2)
2675             m1 = self.manifest.read(c1[0]).copy()
2676             m2 = self.manifest.read(c2[0])
2677     
2678             if use_dirstate:
2679                 oldname = c1[5].get("branch") # stored in UTF-8
2680                 if (not commit and not remove and not force and p2 == nullid
2681                     and branchname == oldname):
2682                     self.ui.status(_("nothing changed\n"))
2683                     return None
2684     
2685             xp1 = hex(p1)
2686             if p2 == nullid: xp2 = ''
2687             else: xp2 = hex(p2)
2688     
2689             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
2690     
2691             tr = self.transaction()
2692             trp = weakref.proxy(tr)
2693     
2694             # check in files
2695             new = {}
2696             changed = []
2697             linkrev = len(self)
2698             for f in commit:
2699                 self.ui.note(f + "\n")
2700                 try:
2701                     fctx = wctx.filectx(f)
2702                     newflags = fctx.flags()
2703                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
2704                     if ((not changed or changed[-1] != f) and
2705                         m2.get(f) != new[f]):
2706                         # mention the file in the changelog if some
2707                         # flag changed, even if there was no content
2708                         # change.
2709                         if m1.flags(f) != newflags:
2710                             changed.append(f)
2711                     m1.set(f, newflags)
2712                     if use_dirstate:
2713                         self.dirstate.normal(f)
2714     
2715                 except (OSError, IOError):
2716                     if use_dirstate:
2717                         self.ui.warn(_("trouble committing %s!\n") % f)
2718                         raise
2719                     else:
2720                         remove.append(f)
2721     
2722             updated, added = [], []
2723             for f in util.sort(changed):
2724                 if f in m1 or f in m2:
2725                     updated.append(f)
2726                 else:
2727                     added.append(f)
2728     
2729             # update manifest
2730             m1.update(new)
2731             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
2732             removed1 = []
2733     
2734             for f in removed:
2735                 if f in m1:
2736                     del m1[f]
2737                     removed1.append(f)
2738             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
2739                                    (new, removed1))
2740     
2741             # add changeset
2742             if (not empty_ok and not text) or force_editor:
2743                 edittext = []
2744                 if text:
2745                     edittext.append(text)
2746                 edittext.append("")
2747                 edittext.append("") # Empty line between message and comments.
2748                 edittext.append(_("HG: Enter commit message."
2749                                   "  Lines beginning with 'HG:' are removed."))
2750                 edittext.append("HG: --")
2751                 edittext.append("HG: user: %s" % user)
2752                 if p2 != nullid:
2753                     edittext.append("HG: branch merge")
2754                 if branchname:
2755                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
2756                 edittext.extend(["HG: added %s" % f for f in added])
2757                 edittext.extend(["HG: changed %s" % f for f in updated])
2758                 edittext.extend(["HG: removed %s" % f for f in removed])
2759                 if not added and not updated and not removed:
2760                     edittext.append("HG: no files changed")
2761                 edittext.append("")
2762                 # run editor in the repository root
2763 E               olddir = os.getcwd()
2764 >               OSError: [Errno 2] No such file or directory
2765 
2766 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
2767 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
2768 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
2769 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
2770 HG: --
2771 HG: user: nobody
2772 HG: branch 'default'
2773 HG: added ab56b4d92b40713acc5af89985d4b786
2774 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
2775 Vim: Beendet.
2776 ]2;Terminal - Terminal]1;Terminal - Terminal
2777 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
2778 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
2779 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
2780 
2781 transaction abort!
2782 rollback completed
2783 transaction abort!
2784 rollback completed
2785 
2786 - - - - - - - -  test_item_rename_to_existing: recorded stderr - - - - - - - - -
2787 transaction abort!
2788 rollback completed
2789 
2790 ________________________________________________________________________________
2791  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_rename_threesome 
2792 
2793     def test_item_rename_threesome(self):
2794 >       item1 = self.create_rev_item_helper("item1")
2795 
2796 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:120]
2797 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2798 
2799     def create_rev_item_helper(self, name):
2800         item = self.backend.create_item(name)
2801         item.create_revision(0)
2802 >       item.commit()
2803 
2804 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
2805 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2806 
2807     def commit(self):
2808         """
2809             @see: Backend._commit_item.__doc__
2810             """
2811         assert self._uncommitted_revision is not None
2812 >       self._backend._commit_item(self._uncommitted_revision)
2813 
2814 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
2815 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2816 
2817     def _commit_item(self, revision, second_parent=None):
2818         """
2819             Commit given Item Revision to repository. Update and commit Item index file.
2820             If Revision already exists, raise RevisionAlreadyExistsError.
2821             """
2822         item = revision.item
2823         lock = self._lock_repo() #XXX: lock item only!
2824         try:
2825             if not item._id:
2826                 self._add_item(item)
2827             elif revision.revno in self._list_revisions(item):
2828                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
2829     
2830             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
2831             if revision.revno > 0:
2832                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
2833                 if second_parent:
2834                     parents.append(second_parent)
2835             else:
2836                 self._open_item_index(item, 'wb').close()
2837                 self._repo.add([item._id, "%s.rev" % item._id])
2838                 parents = []
2839             internal_meta = {'rev': revision.revno,
2840                              'name': item.name,
2841                              'id': item._id,
2842                              'parents': " ".join(parents)}
2843             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
2844             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
2845     
2846             if not revision.timestamp:
2847                 revision.timestamp = long(time.time())
2848             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
2849             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
2850             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
2851             try:
2852                 match = mercurial.match.exact(self._rev_path, '', [item._id])
2853 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
2854 
2855 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
2856 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2857 
2858     def commit(self, files=None, text="", user=None, date=None,
2859                match=None, force=False, force_editor=False,
2860                p1=None, p2=None, extra={}, empty_ok=False):
2861         wlock = lock = None
2862         if extra.get("close"):
2863             force = True
2864         if files:
2865             files = util.unique(files)
2866         try:
2867             wlock = self.wlock()
2868             lock = self.lock()
2869             use_dirstate = (p1 is None) # not rawcommit
2870     
2871             if use_dirstate:
2872                 p1, p2 = self.dirstate.parents()
2873                 update_dirstate = True
2874     
2875                 if (not force and p2 != nullid and
2876                     (match and (match.files() or match.anypats()))):
2877                     raise util.Abort(_('cannot partially commit a merge '
2878                                        '(do not specify files or patterns)'))
2879     
2880                 if files:
2881                     modified, removed = [], []
2882                     for f in files:
2883                         s = self.dirstate[f]
2884                         if s in 'nma':
2885                             modified.append(f)
2886                         elif s == 'r':
2887                             removed.append(f)
2888                         else:
2889                             self.ui.warn(_("%s not tracked!\n") % f)
2890                     changes = [modified, [], removed, [], []]
2891                 else:
2892                     changes = self.status(match=match)
2893             else:
2894                 p1, p2 = p1, p2 or nullid
2895                 update_dirstate = (self.dirstate.parents()[0] == p1)
2896                 changes = [files, [], [], [], []]
2897     
2898             ms = merge_.mergestate(self)
2899             for f in changes[0]:
2900                 if f in ms and ms[f] == 'u':
2901                     raise util.Abort(_("unresolved merge conflicts "
2902                                                     "(see hg resolve)"))
2903             wctx = context.workingctx(self, (p1, p2), text, user, date,
2904                                       extra, changes)
2905             r = self._commitctx(wctx, force, force_editor, empty_ok,
2906 >                               use_dirstate, update_dirstate)
2907 
2908 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
2909 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2910 
2911     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
2912                   use_dirstate=True, update_dirstate=True):
2913         tr = None
2914         valid = 0 # don't save the dirstate if this isn't set
2915         try:
2916             commit = util.sort(wctx.modified() + wctx.added())
2917             remove = wctx.removed()
2918             extra = wctx.extra().copy()
2919             branchname = extra['branch']
2920             user = wctx.user()
2921             text = wctx.description()
2922     
2923             p1, p2 = [p.node() for p in wctx.parents()]
2924             c1 = self.changelog.read(p1)
2925             c2 = self.changelog.read(p2)
2926             m1 = self.manifest.read(c1[0]).copy()
2927             m2 = self.manifest.read(c2[0])
2928     
2929             if use_dirstate:
2930                 oldname = c1[5].get("branch") # stored in UTF-8
2931                 if (not commit and not remove and not force and p2 == nullid
2932                     and branchname == oldname):
2933                     self.ui.status(_("nothing changed\n"))
2934                     return None
2935     
2936             xp1 = hex(p1)
2937             if p2 == nullid: xp2 = ''
2938             else: xp2 = hex(p2)
2939     
2940             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
2941     
2942             tr = self.transaction()
2943             trp = weakref.proxy(tr)
2944     
2945             # check in files
2946             new = {}
2947             changed = []
2948             linkrev = len(self)
2949             for f in commit:
2950                 self.ui.note(f + "\n")
2951                 try:
2952                     fctx = wctx.filectx(f)
2953                     newflags = fctx.flags()
2954                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
2955                     if ((not changed or changed[-1] != f) and
2956                         m2.get(f) != new[f]):
2957                         # mention the file in the changelog if some
2958                         # flag changed, even if there was no content
2959                         # change.
2960                         if m1.flags(f) != newflags:
2961                             changed.append(f)
2962                     m1.set(f, newflags)
2963                     if use_dirstate:
2964                         self.dirstate.normal(f)
2965     
2966                 except (OSError, IOError):
2967                     if use_dirstate:
2968                         self.ui.warn(_("trouble committing %s!\n") % f)
2969                         raise
2970                     else:
2971                         remove.append(f)
2972     
2973             updated, added = [], []
2974             for f in util.sort(changed):
2975                 if f in m1 or f in m2:
2976                     updated.append(f)
2977                 else:
2978                     added.append(f)
2979     
2980             # update manifest
2981             m1.update(new)
2982             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
2983             removed1 = []
2984     
2985             for f in removed:
2986                 if f in m1:
2987                     del m1[f]
2988                     removed1.append(f)
2989             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
2990                                    (new, removed1))
2991     
2992             # add changeset
2993             if (not empty_ok and not text) or force_editor:
2994                 edittext = []
2995                 if text:
2996                     edittext.append(text)
2997                 edittext.append("")
2998                 edittext.append("") # Empty line between message and comments.
2999                 edittext.append(_("HG: Enter commit message."
3000                                   "  Lines beginning with 'HG:' are removed."))
3001                 edittext.append("HG: --")
3002                 edittext.append("HG: user: %s" % user)
3003                 if p2 != nullid:
3004                     edittext.append("HG: branch merge")
3005                 if branchname:
3006                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
3007                 edittext.extend(["HG: added %s" % f for f in added])
3008                 edittext.extend(["HG: changed %s" % f for f in updated])
3009                 edittext.extend(["HG: removed %s" % f for f in removed])
3010                 if not added and not updated and not removed:
3011                     edittext.append("HG: no files changed")
3012                 edittext.append("")
3013                 # run editor in the repository root
3014 E               olddir = os.getcwd()
3015 >               OSError: [Errno 2] No such file or directory
3016 
3017 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
3018 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
3019 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
3020 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
3021 HG: --
3022 HG: user: nobody
3023 HG: branch 'default'
3024 HG: added ab56b4d92b40713acc5af89985d4b786
3025 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
3026 Vim: Beendet.
3027 ]2;Terminal - Terminal]1;Terminal - Terminal
3028 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
3029 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
3030 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
3031 
3032 transaction abort!
3033 rollback completed
3034 transaction abort!
3035 rollback completed
3036 
3037 - - - - - - - -  test_item_rename_threesome: recorded stderr - - - - - - - - -
3038 transaction abort!
3039 rollback completed
3040 
3041 ________________________________________________________________________________
3042 ___ entrypoint: test_backends_hg.py TestMercurialBackend().test_create_order ___
3043 
3044     def test_create_order(self):
3045         item1 = self.backend.create_item('1')
3046         item2 = self.backend.create_item('2')
3047         revision1 = item1.create_revision(0)
3048         revision2 = item2.create_revision(0)
3049         revision1.write('1')
3050         revision2.write('2')
3051 >       item2.commit()
3052 
3053 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:142]
3054 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3055 
3056     def commit(self):
3057         """
3058             @see: Backend._commit_item.__doc__
3059             """
3060         assert self._uncommitted_revision is not None
3061 >       self._backend._commit_item(self._uncommitted_revision)
3062 
3063 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
3064 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3065 
3066     def _commit_item(self, revision, second_parent=None):
3067         """
3068             Commit given Item Revision to repository. Update and commit Item index file.
3069             If Revision already exists, raise RevisionAlreadyExistsError.
3070             """
3071         item = revision.item
3072         lock = self._lock_repo() #XXX: lock item only!
3073         try:
3074             if not item._id:
3075                 self._add_item(item)
3076             elif revision.revno in self._list_revisions(item):
3077                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
3078     
3079             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
3080             if revision.revno > 0:
3081                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
3082                 if second_parent:
3083                     parents.append(second_parent)
3084             else:
3085                 self._open_item_index(item, 'wb').close()
3086                 self._repo.add([item._id, "%s.rev" % item._id])
3087                 parents = []
3088             internal_meta = {'rev': revision.revno,
3089                              'name': item.name,
3090                              'id': item._id,
3091                              'parents': " ".join(parents)}
3092             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
3093             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
3094     
3095             if not revision.timestamp:
3096                 revision.timestamp = long(time.time())
3097             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
3098             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
3099             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
3100             try:
3101                 match = mercurial.match.exact(self._rev_path, '', [item._id])
3102 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
3103 
3104 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
3105 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3106 
3107     def commit(self, files=None, text="", user=None, date=None,
3108                match=None, force=False, force_editor=False,
3109                p1=None, p2=None, extra={}, empty_ok=False):
3110         wlock = lock = None
3111         if extra.get("close"):
3112             force = True
3113         if files:
3114             files = util.unique(files)
3115         try:
3116             wlock = self.wlock()
3117             lock = self.lock()
3118             use_dirstate = (p1 is None) # not rawcommit
3119     
3120             if use_dirstate:
3121                 p1, p2 = self.dirstate.parents()
3122                 update_dirstate = True
3123     
3124                 if (not force and p2 != nullid and
3125                     (match and (match.files() or match.anypats()))):
3126                     raise util.Abort(_('cannot partially commit a merge '
3127                                        '(do not specify files or patterns)'))
3128     
3129                 if files:
3130                     modified, removed = [], []
3131                     for f in files:
3132                         s = self.dirstate[f]
3133                         if s in 'nma':
3134                             modified.append(f)
3135                         elif s == 'r':
3136                             removed.append(f)
3137                         else:
3138                             self.ui.warn(_("%s not tracked!\n") % f)
3139                     changes = [modified, [], removed, [], []]
3140                 else:
3141                     changes = self.status(match=match)
3142             else:
3143                 p1, p2 = p1, p2 or nullid
3144                 update_dirstate = (self.dirstate.parents()[0] == p1)
3145                 changes = [files, [], [], [], []]
3146     
3147             ms = merge_.mergestate(self)
3148             for f in changes[0]:
3149                 if f in ms and ms[f] == 'u':
3150                     raise util.Abort(_("unresolved merge conflicts "
3151                                                     "(see hg resolve)"))
3152             wctx = context.workingctx(self, (p1, p2), text, user, date,
3153                                       extra, changes)
3154             r = self._commitctx(wctx, force, force_editor, empty_ok,
3155 >                               use_dirstate, update_dirstate)
3156 
3157 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
3158 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3159 
3160     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
3161                   use_dirstate=True, update_dirstate=True):
3162         tr = None
3163         valid = 0 # don't save the dirstate if this isn't set
3164         try:
3165             commit = util.sort(wctx.modified() + wctx.added())
3166             remove = wctx.removed()
3167             extra = wctx.extra().copy()
3168             branchname = extra['branch']
3169             user = wctx.user()
3170             text = wctx.description()
3171     
3172             p1, p2 = [p.node() for p in wctx.parents()]
3173             c1 = self.changelog.read(p1)
3174             c2 = self.changelog.read(p2)
3175             m1 = self.manifest.read(c1[0]).copy()
3176             m2 = self.manifest.read(c2[0])
3177     
3178             if use_dirstate:
3179                 oldname = c1[5].get("branch") # stored in UTF-8
3180                 if (not commit and not remove and not force and p2 == nullid
3181                     and branchname == oldname):
3182                     self.ui.status(_("nothing changed\n"))
3183                     return None
3184     
3185             xp1 = hex(p1)
3186             if p2 == nullid: xp2 = ''
3187             else: xp2 = hex(p2)
3188     
3189             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
3190     
3191             tr = self.transaction()
3192             trp = weakref.proxy(tr)
3193     
3194             # check in files
3195             new = {}
3196             changed = []
3197             linkrev = len(self)
3198             for f in commit:
3199                 self.ui.note(f + "\n")
3200                 try:
3201                     fctx = wctx.filectx(f)
3202                     newflags = fctx.flags()
3203                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
3204                     if ((not changed or changed[-1] != f) and
3205                         m2.get(f) != new[f]):
3206                         # mention the file in the changelog if some
3207                         # flag changed, even if there was no content
3208                         # change.
3209                         if m1.flags(f) != newflags:
3210                             changed.append(f)
3211                     m1.set(f, newflags)
3212                     if use_dirstate:
3213                         self.dirstate.normal(f)
3214     
3215                 except (OSError, IOError):
3216                     if use_dirstate:
3217                         self.ui.warn(_("trouble committing %s!\n") % f)
3218                         raise
3219                     else:
3220                         remove.append(f)
3221     
3222             updated, added = [], []
3223             for f in util.sort(changed):
3224                 if f in m1 or f in m2:
3225                     updated.append(f)
3226                 else:
3227                     added.append(f)
3228     
3229             # update manifest
3230             m1.update(new)
3231             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
3232             removed1 = []
3233     
3234             for f in removed:
3235                 if f in m1:
3236                     del m1[f]
3237                     removed1.append(f)
3238             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
3239                                    (new, removed1))
3240     
3241             # add changeset
3242             if (not empty_ok and not text) or force_editor:
3243                 edittext = []
3244                 if text:
3245                     edittext.append(text)
3246                 edittext.append("")
3247                 edittext.append("") # Empty line between message and comments.
3248                 edittext.append(_("HG: Enter commit message."
3249                                   "  Lines beginning with 'HG:' are removed."))
3250                 edittext.append("HG: --")
3251                 edittext.append("HG: user: %s" % user)
3252                 if p2 != nullid:
3253                     edittext.append("HG: branch merge")
3254                 if branchname:
3255                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
3256                 edittext.extend(["HG: added %s" % f for f in added])
3257                 edittext.extend(["HG: changed %s" % f for f in updated])
3258                 edittext.extend(["HG: removed %s" % f for f in removed])
3259                 if not added and not updated and not removed:
3260                     edittext.append("HG: no files changed")
3261                 edittext.append("")
3262                 # run editor in the repository root
3263 E               olddir = os.getcwd()
3264 >               OSError: [Errno 2] No such file or directory
3265 
3266 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
3267 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
3268 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
3269 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
3270 HG: --
3271 HG: user: nobody
3272 HG: branch 'default'
3273 HG: added ab56b4d92b40713acc5af89985d4b786
3274 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
3275 Vim: Beendet.
3276 ]2;Terminal - Terminal]1;Terminal - Terminal
3277 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
3278 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
3279 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
3280 
3281 transaction abort!
3282 rollback completed
3283 transaction abort!
3284 rollback completed
3285 
3286 - - - - - - - - - - -  test_create_order: recorded stderr - - - - - - - - - - - 
3287 transaction abort!
3288 rollback completed
3289 
3290 ________________________________________________________________________________
3291  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_rev_item_again 
3292 
3293     def test_create_rev_item_again(self):
3294 >       self.create_rev_item_helper("item1")
3295 
3296 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:152]
3297 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3298 
3299     def create_rev_item_helper(self, name):
3300         item = self.backend.create_item(name)
3301         item.create_revision(0)
3302 >       item.commit()
3303 
3304 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
3305 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3306 
3307     def commit(self):
3308         """
3309             @see: Backend._commit_item.__doc__
3310             """
3311         assert self._uncommitted_revision is not None
3312 >       self._backend._commit_item(self._uncommitted_revision)
3313 
3314 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
3315 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3316 
3317     def _commit_item(self, revision, second_parent=None):
3318         """
3319             Commit given Item Revision to repository. Update and commit Item index file.
3320             If Revision already exists, raise RevisionAlreadyExistsError.
3321             """
3322         item = revision.item
3323         lock = self._lock_repo() #XXX: lock item only!
3324         try:
3325             if not item._id:
3326                 self._add_item(item)
3327             elif revision.revno in self._list_revisions(item):
3328                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
3329     
3330             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
3331             if revision.revno > 0:
3332                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
3333                 if second_parent:
3334                     parents.append(second_parent)
3335             else:
3336                 self._open_item_index(item, 'wb').close()
3337                 self._repo.add([item._id, "%s.rev" % item._id])
3338                 parents = []
3339             internal_meta = {'rev': revision.revno,
3340                              'name': item.name,
3341                              'id': item._id,
3342                              'parents': " ".join(parents)}
3343             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
3344             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
3345     
3346             if not revision.timestamp:
3347                 revision.timestamp = long(time.time())
3348             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
3349             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
3350             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
3351             try:
3352                 match = mercurial.match.exact(self._rev_path, '', [item._id])
3353 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
3354 
3355 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
3356 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3357 
3358     def commit(self, files=None, text="", user=None, date=None,
3359                match=None, force=False, force_editor=False,
3360                p1=None, p2=None, extra={}, empty_ok=False):
3361         wlock = lock = None
3362         if extra.get("close"):
3363             force = True
3364         if files:
3365             files = util.unique(files)
3366         try:
3367             wlock = self.wlock()
3368             lock = self.lock()
3369             use_dirstate = (p1 is None) # not rawcommit
3370     
3371             if use_dirstate:
3372                 p1, p2 = self.dirstate.parents()
3373                 update_dirstate = True
3374     
3375                 if (not force and p2 != nullid and
3376                     (match and (match.files() or match.anypats()))):
3377                     raise util.Abort(_('cannot partially commit a merge '
3378                                        '(do not specify files or patterns)'))
3379     
3380                 if files:
3381                     modified, removed = [], []
3382                     for f in files:
3383                         s = self.dirstate[f]
3384                         if s in 'nma':
3385                             modified.append(f)
3386                         elif s == 'r':
3387                             removed.append(f)
3388                         else:
3389                             self.ui.warn(_("%s not tracked!\n") % f)
3390                     changes = [modified, [], removed, [], []]
3391                 else:
3392                     changes = self.status(match=match)
3393             else:
3394                 p1, p2 = p1, p2 or nullid
3395                 update_dirstate = (self.dirstate.parents()[0] == p1)
3396                 changes = [files, [], [], [], []]
3397     
3398             ms = merge_.mergestate(self)
3399             for f in changes[0]:
3400                 if f in ms and ms[f] == 'u':
3401                     raise util.Abort(_("unresolved merge conflicts "
3402                                                     "(see hg resolve)"))
3403             wctx = context.workingctx(self, (p1, p2), text, user, date,
3404                                       extra, changes)
3405             r = self._commitctx(wctx, force, force_editor, empty_ok,
3406 >                               use_dirstate, update_dirstate)
3407 
3408 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
3409 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3410 
3411     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
3412                   use_dirstate=True, update_dirstate=True):
3413         tr = None
3414         valid = 0 # don't save the dirstate if this isn't set
3415         try:
3416             commit = util.sort(wctx.modified() + wctx.added())
3417             remove = wctx.removed()
3418             extra = wctx.extra().copy()
3419             branchname = extra['branch']
3420             user = wctx.user()
3421             text = wctx.description()
3422     
3423             p1, p2 = [p.node() for p in wctx.parents()]
3424             c1 = self.changelog.read(p1)
3425             c2 = self.changelog.read(p2)
3426             m1 = self.manifest.read(c1[0]).copy()
3427             m2 = self.manifest.read(c2[0])
3428     
3429             if use_dirstate:
3430                 oldname = c1[5].get("branch") # stored in UTF-8
3431                 if (not commit and not remove and not force and p2 == nullid
3432                     and branchname == oldname):
3433                     self.ui.status(_("nothing changed\n"))
3434                     return None
3435     
3436             xp1 = hex(p1)
3437             if p2 == nullid: xp2 = ''
3438             else: xp2 = hex(p2)
3439     
3440             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
3441     
3442             tr = self.transaction()
3443             trp = weakref.proxy(tr)
3444     
3445             # check in files
3446             new = {}
3447             changed = []
3448             linkrev = len(self)
3449             for f in commit:
3450                 self.ui.note(f + "\n")
3451                 try:
3452                     fctx = wctx.filectx(f)
3453                     newflags = fctx.flags()
3454                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
3455                     if ((not changed or changed[-1] != f) and
3456                         m2.get(f) != new[f]):
3457                         # mention the file in the changelog if some
3458                         # flag changed, even if there was no content
3459                         # change.
3460                         if m1.flags(f) != newflags:
3461                             changed.append(f)
3462                     m1.set(f, newflags)
3463                     if use_dirstate:
3464                         self.dirstate.normal(f)
3465     
3466                 except (OSError, IOError):
3467                     if use_dirstate:
3468                         self.ui.warn(_("trouble committing %s!\n") % f)
3469                         raise
3470                     else:
3471                         remove.append(f)
3472     
3473             updated, added = [], []
3474             for f in util.sort(changed):
3475                 if f in m1 or f in m2:
3476                     updated.append(f)
3477                 else:
3478                     added.append(f)
3479     
3480             # update manifest
3481             m1.update(new)
3482             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
3483             removed1 = []
3484     
3485             for f in removed:
3486                 if f in m1:
3487                     del m1[f]
3488                     removed1.append(f)
3489             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
3490                                    (new, removed1))
3491     
3492             # add changeset
3493             if (not empty_ok and not text) or force_editor:
3494                 edittext = []
3495                 if text:
3496                     edittext.append(text)
3497                 edittext.append("")
3498                 edittext.append("") # Empty line between message and comments.
3499                 edittext.append(_("HG: Enter commit message."
3500                                   "  Lines beginning with 'HG:' are removed."))
3501                 edittext.append("HG: --")
3502                 edittext.append("HG: user: %s" % user)
3503                 if p2 != nullid:
3504                     edittext.append("HG: branch merge")
3505                 if branchname:
3506                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
3507                 edittext.extend(["HG: added %s" % f for f in added])
3508                 edittext.extend(["HG: changed %s" % f for f in updated])
3509                 edittext.extend(["HG: removed %s" % f for f in removed])
3510                 if not added and not updated and not removed:
3511                     edittext.append("HG: no files changed")
3512                 edittext.append("")
3513                 # run editor in the repository root
3514 E               olddir = os.getcwd()
3515 >               OSError: [Errno 2] No such file or directory
3516 
3517 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
3518 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
3519 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
3520 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
3521 HG: --
3522 HG: user: nobody
3523 HG: branch 'default'
3524 HG: added ab56b4d92b40713acc5af89985d4b786
3525 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
3526 Vim: Beendet.
3527 ]2;Terminal - Terminal]1;Terminal - Terminal
3528 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
3529 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
3530 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
3531 
3532 transaction abort!
3533 rollback completed
3534 transaction abort!
3535 rollback completed
3536 
3537 - - - - - - - -  test_create_rev_item_again: recorded stderr - - - - - - - - -
3538 transaction abort!
3539 rollback completed
3540 
3541 ________________________________________________________________________________
3542 _____ entrypoint: test_backends_hg.py TestMercurialBackend().test_has_item _____
3543 
3544     def test_has_item(self):
3545 >       self.create_rev_item_helper("versioned")
3546 
3547 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:163]
3548 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3549 
3550     def create_rev_item_helper(self, name):
3551         item = self.backend.create_item(name)
3552         item.create_revision(0)
3553 >       item.commit()
3554 
3555 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
3556 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3557 
3558     def commit(self):
3559         """
3560             @see: Backend._commit_item.__doc__
3561             """
3562         assert self._uncommitted_revision is not None
3563 >       self._backend._commit_item(self._uncommitted_revision)
3564 
3565 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
3566 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3567 
3568     def _commit_item(self, revision, second_parent=None):
3569         """
3570             Commit given Item Revision to repository. Update and commit Item index file.
3571             If Revision already exists, raise RevisionAlreadyExistsError.
3572             """
3573         item = revision.item
3574         lock = self._lock_repo() #XXX: lock item only!
3575         try:
3576             if not item._id:
3577                 self._add_item(item)
3578             elif revision.revno in self._list_revisions(item):
3579                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
3580     
3581             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
3582             if revision.revno > 0:
3583                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
3584                 if second_parent:
3585                     parents.append(second_parent)
3586             else:
3587                 self._open_item_index(item, 'wb').close()
3588                 self._repo.add([item._id, "%s.rev" % item._id])
3589                 parents = []
3590             internal_meta = {'rev': revision.revno,
3591                              'name': item.name,
3592                              'id': item._id,
3593                              'parents': " ".join(parents)}
3594             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
3595             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
3596     
3597             if not revision.timestamp:
3598                 revision.timestamp = long(time.time())
3599             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
3600             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
3601             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
3602             try:
3603                 match = mercurial.match.exact(self._rev_path, '', [item._id])
3604 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
3605 
3606 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
3607 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3608 
3609     def commit(self, files=None, text="", user=None, date=None,
3610                match=None, force=False, force_editor=False,
3611                p1=None, p2=None, extra={}, empty_ok=False):
3612         wlock = lock = None
3613         if extra.get("close"):
3614             force = True
3615         if files:
3616             files = util.unique(files)
3617         try:
3618             wlock = self.wlock()
3619             lock = self.lock()
3620             use_dirstate = (p1 is None) # not rawcommit
3621     
3622             if use_dirstate:
3623                 p1, p2 = self.dirstate.parents()
3624                 update_dirstate = True
3625     
3626                 if (not force and p2 != nullid and
3627                     (match and (match.files() or match.anypats()))):
3628                     raise util.Abort(_('cannot partially commit a merge '
3629                                        '(do not specify files or patterns)'))
3630     
3631                 if files:
3632                     modified, removed = [], []
3633                     for f in files:
3634                         s = self.dirstate[f]
3635                         if s in 'nma':
3636                             modified.append(f)
3637                         elif s == 'r':
3638                             removed.append(f)
3639                         else:
3640                             self.ui.warn(_("%s not tracked!\n") % f)
3641                     changes = [modified, [], removed, [], []]
3642                 else:
3643                     changes = self.status(match=match)
3644             else:
3645                 p1, p2 = p1, p2 or nullid
3646                 update_dirstate = (self.dirstate.parents()[0] == p1)
3647                 changes = [files, [], [], [], []]
3648     
3649             ms = merge_.mergestate(self)
3650             for f in changes[0]:
3651                 if f in ms and ms[f] == 'u':
3652                     raise util.Abort(_("unresolved merge conflicts "
3653                                                     "(see hg resolve)"))
3654             wctx = context.workingctx(self, (p1, p2), text, user, date,
3655                                       extra, changes)
3656             r = self._commitctx(wctx, force, force_editor, empty_ok,
3657 >                               use_dirstate, update_dirstate)
3658 
3659 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
3660 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3661 
3662     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
3663                   use_dirstate=True, update_dirstate=True):
3664         tr = None
3665         valid = 0 # don't save the dirstate if this isn't set
3666         try:
3667             commit = util.sort(wctx.modified() + wctx.added())
3668             remove = wctx.removed()
3669             extra = wctx.extra().copy()
3670             branchname = extra['branch']
3671             user = wctx.user()
3672             text = wctx.description()
3673     
3674             p1, p2 = [p.node() for p in wctx.parents()]
3675             c1 = self.changelog.read(p1)
3676             c2 = self.changelog.read(p2)
3677             m1 = self.manifest.read(c1[0]).copy()
3678             m2 = self.manifest.read(c2[0])
3679     
3680             if use_dirstate:
3681                 oldname = c1[5].get("branch") # stored in UTF-8
3682                 if (not commit and not remove and not force and p2 == nullid
3683                     and branchname == oldname):
3684                     self.ui.status(_("nothing changed\n"))
3685                     return None
3686     
3687             xp1 = hex(p1)
3688             if p2 == nullid: xp2 = ''
3689             else: xp2 = hex(p2)
3690     
3691             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
3692     
3693             tr = self.transaction()
3694             trp = weakref.proxy(tr)
3695     
3696             # check in files
3697             new = {}
3698             changed = []
3699             linkrev = len(self)
3700             for f in commit:
3701                 self.ui.note(f + "\n")
3702                 try:
3703                     fctx = wctx.filectx(f)
3704                     newflags = fctx.flags()
3705                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
3706                     if ((not changed or changed[-1] != f) and
3707                         m2.get(f) != new[f]):
3708                         # mention the file in the changelog if some
3709                         # flag changed, even if there was no content
3710                         # change.
3711                         if m1.flags(f) != newflags:
3712                             changed.append(f)
3713                     m1.set(f, newflags)
3714                     if use_dirstate:
3715                         self.dirstate.normal(f)
3716     
3717                 except (OSError, IOError):
3718                     if use_dirstate:
3719                         self.ui.warn(_("trouble committing %s!\n") % f)
3720                         raise
3721                     else:
3722                         remove.append(f)
3723     
3724             updated, added = [], []
3725             for f in util.sort(changed):
3726                 if f in m1 or f in m2:
3727                     updated.append(f)
3728                 else:
3729                     added.append(f)
3730     
3731             # update manifest
3732             m1.update(new)
3733             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
3734             removed1 = []
3735     
3736             for f in removed:
3737                 if f in m1:
3738                     del m1[f]
3739                     removed1.append(f)
3740             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
3741                                    (new, removed1))
3742     
3743             # add changeset
3744             if (not empty_ok and not text) or force_editor:
3745                 edittext = []
3746                 if text:
3747                     edittext.append(text)
3748                 edittext.append("")
3749                 edittext.append("") # Empty line between message and comments.
3750                 edittext.append(_("HG: Enter commit message."
3751                                   "  Lines beginning with 'HG:' are removed."))
3752                 edittext.append("HG: --")
3753                 edittext.append("HG: user: %s" % user)
3754                 if p2 != nullid:
3755                     edittext.append("HG: branch merge")
3756                 if branchname:
3757                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
3758                 edittext.extend(["HG: added %s" % f for f in added])
3759                 edittext.extend(["HG: changed %s" % f for f in updated])
3760                 edittext.extend(["HG: removed %s" % f for f in removed])
3761                 if not added and not updated and not removed:
3762                     edittext.append("HG: no files changed")
3763                 edittext.append("")
3764                 # run editor in the repository root
3765 E               olddir = os.getcwd()
3766 >               OSError: [Errno 2] No such file or directory
3767 
3768 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
3769 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
3770 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
3771 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
3772 HG: --
3773 HG: user: nobody
3774 HG: branch 'default'
3775 HG: added ab56b4d92b40713acc5af89985d4b786
3776 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
3777 Vim: Beendet.
3778 ]2;Terminal - Terminal]1;Terminal - Terminal
3779 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
3780 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
3781 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
3782 
3783 transaction abort!
3784 rollback completed
3785 transaction abort!
3786 rollback completed
3787 
3788 - - - - - - - - - - - -  test_has_item: recorded stderr - - - - - - - - - - - - 
3789 transaction abort!
3790 rollback completed
3791 
3792 ________________________________________________________________________________
3793 __ entrypoint: test_backends_hg.py TestMercurialBackend().test_search_simple ___
3794 
3795     def test_search_simple(self):
3796         for name in ["songlist", "song lyric", "odd_SONG_item"]:
3797 >           self.create_rev_item_helper(name)
3798 
3799 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:173]
3800 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3801 
3802     def create_rev_item_helper(self, name):
3803         item = self.backend.create_item(name)
3804         item.create_revision(0)
3805 >       item.commit()
3806 
3807 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
3808 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3809 
3810     def commit(self):
3811         """
3812             @see: Backend._commit_item.__doc__
3813             """
3814         assert self._uncommitted_revision is not None
3815 >       self._backend._commit_item(self._uncommitted_revision)
3816 
3817 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
3818 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3819 
3820     def _commit_item(self, revision, second_parent=None):
3821         """
3822             Commit given Item Revision to repository. Update and commit Item index file.
3823             If Revision already exists, raise RevisionAlreadyExistsError.
3824             """
3825         item = revision.item
3826         lock = self._lock_repo() #XXX: lock item only!
3827         try:
3828             if not item._id:
3829                 self._add_item(item)
3830             elif revision.revno in self._list_revisions(item):
3831                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
3832     
3833             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
3834             if revision.revno > 0:
3835                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
3836                 if second_parent:
3837                     parents.append(second_parent)
3838             else:
3839                 self._open_item_index(item, 'wb').close()
3840                 self._repo.add([item._id, "%s.rev" % item._id])
3841                 parents = []
3842             internal_meta = {'rev': revision.revno,
3843                              'name': item.name,
3844                              'id': item._id,
3845                              'parents': " ".join(parents)}
3846             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
3847             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
3848     
3849             if not revision.timestamp:
3850                 revision.timestamp = long(time.time())
3851             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
3852             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
3853             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
3854             try:
3855                 match = mercurial.match.exact(self._rev_path, '', [item._id])
3856 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
3857 
3858 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
3859 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3860 
3861     def commit(self, files=None, text="", user=None, date=None,
3862                match=None, force=False, force_editor=False,
3863                p1=None, p2=None, extra={}, empty_ok=False):
3864         wlock = lock = None
3865         if extra.get("close"):
3866             force = True
3867         if files:
3868             files = util.unique(files)
3869         try:
3870             wlock = self.wlock()
3871             lock = self.lock()
3872             use_dirstate = (p1 is None) # not rawcommit
3873     
3874             if use_dirstate:
3875                 p1, p2 = self.dirstate.parents()
3876                 update_dirstate = True
3877     
3878                 if (not force and p2 != nullid and
3879                     (match and (match.files() or match.anypats()))):
3880                     raise util.Abort(_('cannot partially commit a merge '
3881                                        '(do not specify files or patterns)'))
3882     
3883                 if files:
3884                     modified, removed = [], []
3885                     for f in files:
3886                         s = self.dirstate[f]
3887                         if s in 'nma':
3888                             modified.append(f)
3889                         elif s == 'r':
3890                             removed.append(f)
3891                         else:
3892                             self.ui.warn(_("%s not tracked!\n") % f)
3893                     changes = [modified, [], removed, [], []]
3894                 else:
3895                     changes = self.status(match=match)
3896             else:
3897                 p1, p2 = p1, p2 or nullid
3898                 update_dirstate = (self.dirstate.parents()[0] == p1)
3899                 changes = [files, [], [], [], []]
3900     
3901             ms = merge_.mergestate(self)
3902             for f in changes[0]:
3903                 if f in ms and ms[f] == 'u':
3904                     raise util.Abort(_("unresolved merge conflicts "
3905                                                     "(see hg resolve)"))
3906             wctx = context.workingctx(self, (p1, p2), text, user, date,
3907                                       extra, changes)
3908             r = self._commitctx(wctx, force, force_editor, empty_ok,
3909 >                               use_dirstate, update_dirstate)
3910 
3911 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
3912 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
3913 
3914     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
3915                   use_dirstate=True, update_dirstate=True):
3916         tr = None
3917         valid = 0 # don't save the dirstate if this isn't set
3918         try:
3919             commit = util.sort(wctx.modified() + wctx.added())
3920             remove = wctx.removed()
3921             extra = wctx.extra().copy()
3922             branchname = extra['branch']
3923             user = wctx.user()
3924             text = wctx.description()
3925     
3926             p1, p2 = [p.node() for p in wctx.parents()]
3927             c1 = self.changelog.read(p1)
3928             c2 = self.changelog.read(p2)
3929             m1 = self.manifest.read(c1[0]).copy()
3930             m2 = self.manifest.read(c2[0])
3931     
3932             if use_dirstate:
3933                 oldname = c1[5].get("branch") # stored in UTF-8
3934                 if (not commit and not remove and not force and p2 == nullid
3935                     and branchname == oldname):
3936                     self.ui.status(_("nothing changed\n"))
3937                     return None
3938     
3939             xp1 = hex(p1)
3940             if p2 == nullid: xp2 = ''
3941             else: xp2 = hex(p2)
3942     
3943             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
3944     
3945             tr = self.transaction()
3946             trp = weakref.proxy(tr)
3947     
3948             # check in files
3949             new = {}
3950             changed = []
3951             linkrev = len(self)
3952             for f in commit:
3953                 self.ui.note(f + "\n")
3954                 try:
3955                     fctx = wctx.filectx(f)
3956                     newflags = fctx.flags()
3957                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
3958                     if ((not changed or changed[-1] != f) and
3959                         m2.get(f) != new[f]):
3960                         # mention the file in the changelog if some
3961                         # flag changed, even if there was no content
3962                         # change.
3963                         if m1.flags(f) != newflags:
3964                             changed.append(f)
3965                     m1.set(f, newflags)
3966                     if use_dirstate:
3967                         self.dirstate.normal(f)
3968     
3969                 except (OSError, IOError):
3970                     if use_dirstate:
3971                         self.ui.warn(_("trouble committing %s!\n") % f)
3972                         raise
3973                     else:
3974                         remove.append(f)
3975     
3976             updated, added = [], []
3977             for f in util.sort(changed):
3978                 if f in m1 or f in m2:
3979                     updated.append(f)
3980                 else:
3981                     added.append(f)
3982     
3983             # update manifest
3984             m1.update(new)
3985             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
3986             removed1 = []
3987     
3988             for f in removed:
3989                 if f in m1:
3990                     del m1[f]
3991                     removed1.append(f)
3992             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
3993                                    (new, removed1))
3994     
3995             # add changeset
3996             if (not empty_ok and not text) or force_editor:
3997                 edittext = []
3998                 if text:
3999                     edittext.append(text)
4000                 edittext.append("")
4001                 edittext.append("") # Empty line between message and comments.
4002                 edittext.append(_("HG: Enter commit message."
4003                                   "  Lines beginning with 'HG:' are removed."))
4004                 edittext.append("HG: --")
4005                 edittext.append("HG: user: %s" % user)
4006                 if p2 != nullid:
4007                     edittext.append("HG: branch merge")
4008                 if branchname:
4009                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
4010                 edittext.extend(["HG: added %s" % f for f in added])
4011                 edittext.extend(["HG: changed %s" % f for f in updated])
4012                 edittext.extend(["HG: removed %s" % f for f in removed])
4013                 if not added and not updated and not removed:
4014                     edittext.append("HG: no files changed")
4015                 edittext.append("")
4016                 # run editor in the repository root
4017 E               olddir = os.getcwd()
4018 >               OSError: [Errno 2] No such file or directory
4019 
4020 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
4021 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
4022 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
4023 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
4024 HG: --
4025 HG: user: nobody
4026 HG: branch 'default'
4027 HG: added ab56b4d92b40713acc5af89985d4b786
4028 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
4029 Vim: Beendet.
4030 ]2;Terminal - Terminal]1;Terminal - Terminal
4031 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
4032 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
4033 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
4034 
4035 transaction abort!
4036 rollback completed
4037 transaction abort!
4038 rollback completed
4039 
4040 - - - - - - - - - -  test_search_simple: recorded stderr - - - - - - - - - - -
4041 transaction abort!
4042 rollback completed
4043 
4044 ________________________________________________________________________________
4045 __ entrypoint: test_backends_hg.py TestMercurialBackend().test_search_better ___
4046 
4047     def test_search_better(self):
4048 >       self.create_rev_item_helper('abcde')
4049 
4050 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:182]
4051 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4052 
4053     def create_rev_item_helper(self, name):
4054         item = self.backend.create_item(name)
4055         item.create_revision(0)
4056 >       item.commit()
4057 
4058 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
4059 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4060 
4061     def commit(self):
4062         """
4063             @see: Backend._commit_item.__doc__
4064             """
4065         assert self._uncommitted_revision is not None
4066 >       self._backend._commit_item(self._uncommitted_revision)
4067 
4068 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
4069 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4070 
4071     def _commit_item(self, revision, second_parent=None):
4072         """
4073             Commit given Item Revision to repository. Update and commit Item index file.
4074             If Revision already exists, raise RevisionAlreadyExistsError.
4075             """
4076         item = revision.item
4077         lock = self._lock_repo() #XXX: lock item only!
4078         try:
4079             if not item._id:
4080                 self._add_item(item)
4081             elif revision.revno in self._list_revisions(item):
4082                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
4083     
4084             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
4085             if revision.revno > 0:
4086                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
4087                 if second_parent:
4088                     parents.append(second_parent)
4089             else:
4090                 self._open_item_index(item, 'wb').close()
4091                 self._repo.add([item._id, "%s.rev" % item._id])
4092                 parents = []
4093             internal_meta = {'rev': revision.revno,
4094                              'name': item.name,
4095                              'id': item._id,
4096                              'parents': " ".join(parents)}
4097             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
4098             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
4099     
4100             if not revision.timestamp:
4101                 revision.timestamp = long(time.time())
4102             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
4103             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
4104             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
4105             try:
4106                 match = mercurial.match.exact(self._rev_path, '', [item._id])
4107 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
4108 
4109 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
4110 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4111 
4112     def commit(self, files=None, text="", user=None, date=None,
4113                match=None, force=False, force_editor=False,
4114                p1=None, p2=None, extra={}, empty_ok=False):
4115         wlock = lock = None
4116         if extra.get("close"):
4117             force = True
4118         if files:
4119             files = util.unique(files)
4120         try:
4121             wlock = self.wlock()
4122             lock = self.lock()
4123             use_dirstate = (p1 is None) # not rawcommit
4124     
4125             if use_dirstate:
4126                 p1, p2 = self.dirstate.parents()
4127                 update_dirstate = True
4128     
4129                 if (not force and p2 != nullid and
4130                     (match and (match.files() or match.anypats()))):
4131                     raise util.Abort(_('cannot partially commit a merge '
4132                                        '(do not specify files or patterns)'))
4133     
4134                 if files:
4135                     modified, removed = [], []
4136                     for f in files:
4137                         s = self.dirstate[f]
4138                         if s in 'nma':
4139                             modified.append(f)
4140                         elif s == 'r':
4141                             removed.append(f)
4142                         else:
4143                             self.ui.warn(_("%s not tracked!\n") % f)
4144                     changes = [modified, [], removed, [], []]
4145                 else:
4146                     changes = self.status(match=match)
4147             else:
4148                 p1, p2 = p1, p2 or nullid
4149                 update_dirstate = (self.dirstate.parents()[0] == p1)
4150                 changes = [files, [], [], [], []]
4151     
4152             ms = merge_.mergestate(self)
4153             for f in changes[0]:
4154                 if f in ms and ms[f] == 'u':
4155                     raise util.Abort(_("unresolved merge conflicts "
4156                                                     "(see hg resolve)"))
4157             wctx = context.workingctx(self, (p1, p2), text, user, date,
4158                                       extra, changes)
4159             r = self._commitctx(wctx, force, force_editor, empty_ok,
4160 >                               use_dirstate, update_dirstate)
4161 
4162 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
4163 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4164 
4165     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
4166                   use_dirstate=True, update_dirstate=True):
4167         tr = None
4168         valid = 0 # don't save the dirstate if this isn't set
4169         try:
4170             commit = util.sort(wctx.modified() + wctx.added())
4171             remove = wctx.removed()
4172             extra = wctx.extra().copy()
4173             branchname = extra['branch']
4174             user = wctx.user()
4175             text = wctx.description()
4176     
4177             p1, p2 = [p.node() for p in wctx.parents()]
4178             c1 = self.changelog.read(p1)
4179             c2 = self.changelog.read(p2)
4180             m1 = self.manifest.read(c1[0]).copy()
4181             m2 = self.manifest.read(c2[0])
4182     
4183             if use_dirstate:
4184                 oldname = c1[5].get("branch") # stored in UTF-8
4185                 if (not commit and not remove and not force and p2 == nullid
4186                     and branchname == oldname):
4187                     self.ui.status(_("nothing changed\n"))
4188                     return None
4189     
4190             xp1 = hex(p1)
4191             if p2 == nullid: xp2 = ''
4192             else: xp2 = hex(p2)
4193     
4194             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
4195     
4196             tr = self.transaction()
4197             trp = weakref.proxy(tr)
4198     
4199             # check in files
4200             new = {}
4201             changed = []
4202             linkrev = len(self)
4203             for f in commit:
4204                 self.ui.note(f + "\n")
4205                 try:
4206                     fctx = wctx.filectx(f)
4207                     newflags = fctx.flags()
4208                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
4209                     if ((not changed or changed[-1] != f) and
4210                         m2.get(f) != new[f]):
4211                         # mention the file in the changelog if some
4212                         # flag changed, even if there was no content
4213                         # change.
4214                         if m1.flags(f) != newflags:
4215                             changed.append(f)
4216                     m1.set(f, newflags)
4217                     if use_dirstate:
4218                         self.dirstate.normal(f)
4219     
4220                 except (OSError, IOError):
4221                     if use_dirstate:
4222                         self.ui.warn(_("trouble committing %s!\n") % f)
4223                         raise
4224                     else:
4225                         remove.append(f)
4226     
4227             updated, added = [], []
4228             for f in util.sort(changed):
4229                 if f in m1 or f in m2:
4230                     updated.append(f)
4231                 else:
4232                     added.append(f)
4233     
4234             # update manifest
4235             m1.update(new)
4236             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
4237             removed1 = []
4238     
4239             for f in removed:
4240                 if f in m1:
4241                     del m1[f]
4242                     removed1.append(f)
4243             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
4244                                    (new, removed1))
4245     
4246             # add changeset
4247             if (not empty_ok and not text) or force_editor:
4248                 edittext = []
4249                 if text:
4250                     edittext.append(text)
4251                 edittext.append("")
4252                 edittext.append("") # Empty line between message and comments.
4253                 edittext.append(_("HG: Enter commit message."
4254                                   "  Lines beginning with 'HG:' are removed."))
4255                 edittext.append("HG: --")
4256                 edittext.append("HG: user: %s" % user)
4257                 if p2 != nullid:
4258                     edittext.append("HG: branch merge")
4259                 if branchname:
4260                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
4261                 edittext.extend(["HG: added %s" % f for f in added])
4262                 edittext.extend(["HG: changed %s" % f for f in updated])
4263                 edittext.extend(["HG: removed %s" % f for f in removed])
4264                 if not added and not updated and not removed:
4265                     edittext.append("HG: no files changed")
4266                 edittext.append("")
4267                 # run editor in the repository root
4268 E               olddir = os.getcwd()
4269 >               OSError: [Errno 2] No such file or directory
4270 
4271 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
4272 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
4273 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
4274 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
4275 HG: --
4276 HG: user: nobody
4277 HG: branch 'default'
4278 HG: added ab56b4d92b40713acc5af89985d4b786
4279 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
4280 Vim: Beendet.
4281 ]2;Terminal - Terminal]1;Terminal - Terminal
4282 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
4283 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
4284 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
4285 
4286 transaction abort!
4287 rollback completed
4288 transaction abort!
4289 rollback completed
4290 
4291 ________________________________________________________________________________
4292 ___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_1 ____
4293 
4294     def test_iteritems_1(self):
4295         for num in range(10, 20):
4296 >           self.create_rev_item_helper("item_" + str(num).zfill(2))
4297 
4298 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:200]
4299 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4300 
4301     def create_rev_item_helper(self, name):
4302         item = self.backend.create_item(name)
4303         item.create_revision(0)
4304 >       item.commit()
4305 
4306 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
4307 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4308 
4309     def commit(self):
4310         """
4311             @see: Backend._commit_item.__doc__
4312             """
4313         assert self._uncommitted_revision is not None
4314 >       self._backend._commit_item(self._uncommitted_revision)
4315 
4316 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
4317 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4318 
4319     def _commit_item(self, revision, second_parent=None):
4320         """
4321             Commit given Item Revision to repository. Update and commit Item index file.
4322             If Revision already exists, raise RevisionAlreadyExistsError.
4323             """
4324         item = revision.item
4325         lock = self._lock_repo() #XXX: lock item only!
4326         try:
4327             if not item._id:
4328                 self._add_item(item)
4329             elif revision.revno in self._list_revisions(item):
4330                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
4331     
4332             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
4333             if revision.revno > 0:
4334                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
4335                 if second_parent:
4336                     parents.append(second_parent)
4337             else:
4338                 self._open_item_index(item, 'wb').close()
4339                 self._repo.add([item._id, "%s.rev" % item._id])
4340                 parents = []
4341             internal_meta = {'rev': revision.revno,
4342                              'name': item.name,
4343                              'id': item._id,
4344                              'parents': " ".join(parents)}
4345             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
4346             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
4347     
4348             if not revision.timestamp:
4349                 revision.timestamp = long(time.time())
4350             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
4351             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
4352             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
4353             try:
4354                 match = mercurial.match.exact(self._rev_path, '', [item._id])
4355 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
4356 
4357 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
4358 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4359 
4360     def commit(self, files=None, text="", user=None, date=None,
4361                match=None, force=False, force_editor=False,
4362                p1=None, p2=None, extra={}, empty_ok=False):
4363         wlock = lock = None
4364         if extra.get("close"):
4365             force = True
4366         if files:
4367             files = util.unique(files)
4368         try:
4369             wlock = self.wlock()
4370             lock = self.lock()
4371             use_dirstate = (p1 is None) # not rawcommit
4372     
4373             if use_dirstate:
4374                 p1, p2 = self.dirstate.parents()
4375                 update_dirstate = True
4376     
4377                 if (not force and p2 != nullid and
4378                     (match and (match.files() or match.anypats()))):
4379                     raise util.Abort(_('cannot partially commit a merge '
4380                                        '(do not specify files or patterns)'))
4381     
4382                 if files:
4383                     modified, removed = [], []
4384                     for f in files:
4385                         s = self.dirstate[f]
4386                         if s in 'nma':
4387                             modified.append(f)
4388                         elif s == 'r':
4389                             removed.append(f)
4390                         else:
4391                             self.ui.warn(_("%s not tracked!\n") % f)
4392                     changes = [modified, [], removed, [], []]
4393                 else:
4394                     changes = self.status(match=match)
4395             else:
4396                 p1, p2 = p1, p2 or nullid
4397                 update_dirstate = (self.dirstate.parents()[0] == p1)
4398                 changes = [files, [], [], [], []]
4399     
4400             ms = merge_.mergestate(self)
4401             for f in changes[0]:
4402                 if f in ms and ms[f] == 'u':
4403                     raise util.Abort(_("unresolved merge conflicts "
4404                                                     "(see hg resolve)"))
4405             wctx = context.workingctx(self, (p1, p2), text, user, date,
4406                                       extra, changes)
4407             r = self._commitctx(wctx, force, force_editor, empty_ok,
4408 >                               use_dirstate, update_dirstate)
4409 
4410 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
4411 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4412 
4413     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
4414                   use_dirstate=True, update_dirstate=True):
4415         tr = None
4416         valid = 0 # don't save the dirstate if this isn't set
4417         try:
4418             commit = util.sort(wctx.modified() + wctx.added())
4419             remove = wctx.removed()
4420             extra = wctx.extra().copy()
4421             branchname = extra['branch']
4422             user = wctx.user()
4423             text = wctx.description()
4424     
4425             p1, p2 = [p.node() for p in wctx.parents()]
4426             c1 = self.changelog.read(p1)
4427             c2 = self.changelog.read(p2)
4428             m1 = self.manifest.read(c1[0]).copy()
4429             m2 = self.manifest.read(c2[0])
4430     
4431             if use_dirstate:
4432                 oldname = c1[5].get("branch") # stored in UTF-8
4433                 if (not commit and not remove and not force and p2 == nullid
4434                     and branchname == oldname):
4435                     self.ui.status(_("nothing changed\n"))
4436                     return None
4437     
4438             xp1 = hex(p1)
4439             if p2 == nullid: xp2 = ''
4440             else: xp2 = hex(p2)
4441     
4442             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
4443     
4444             tr = self.transaction()
4445             trp = weakref.proxy(tr)
4446     
4447             # check in files
4448             new = {}
4449             changed = []
4450             linkrev = len(self)
4451             for f in commit:
4452                 self.ui.note(f + "\n")
4453                 try:
4454                     fctx = wctx.filectx(f)
4455                     newflags = fctx.flags()
4456                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
4457                     if ((not changed or changed[-1] != f) and
4458                         m2.get(f) != new[f]):
4459                         # mention the file in the changelog if some
4460                         # flag changed, even if there was no content
4461                         # change.
4462                         if m1.flags(f) != newflags:
4463                             changed.append(f)
4464                     m1.set(f, newflags)
4465                     if use_dirstate:
4466                         self.dirstate.normal(f)
4467     
4468                 except (OSError, IOError):
4469                     if use_dirstate:
4470                         self.ui.warn(_("trouble committing %s!\n") % f)
4471                         raise
4472                     else:
4473                         remove.append(f)
4474     
4475             updated, added = [], []
4476             for f in util.sort(changed):
4477                 if f in m1 or f in m2:
4478                     updated.append(f)
4479                 else:
4480                     added.append(f)
4481     
4482             # update manifest
4483             m1.update(new)
4484             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
4485             removed1 = []
4486     
4487             for f in removed:
4488                 if f in m1:
4489                     del m1[f]
4490                     removed1.append(f)
4491             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
4492                                    (new, removed1))
4493     
4494             # add changeset
4495             if (not empty_ok and not text) or force_editor:
4496                 edittext = []
4497                 if text:
4498                     edittext.append(text)
4499                 edittext.append("")
4500                 edittext.append("") # Empty line between message and comments.
4501                 edittext.append(_("HG: Enter commit message."
4502                                   "  Lines beginning with 'HG:' are removed."))
4503                 edittext.append("HG: --")
4504                 edittext.append("HG: user: %s" % user)
4505                 if p2 != nullid:
4506                     edittext.append("HG: branch merge")
4507                 if branchname:
4508                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
4509                 edittext.extend(["HG: added %s" % f for f in added])
4510                 edittext.extend(["HG: changed %s" % f for f in updated])
4511                 edittext.extend(["HG: removed %s" % f for f in removed])
4512                 if not added and not updated and not removed:
4513                     edittext.append("HG: no files changed")
4514                 edittext.append("")
4515                 # run editor in the repository root
4516 E               olddir = os.getcwd()
4517 >               OSError: [Errno 2] No such file or directory
4518 
4519 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
4520 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
4521 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
4522 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
4523 HG: --
4524 HG: user: nobody
4525 HG: branch 'default'
4526 HG: added ab56b4d92b40713acc5af89985d4b786
4527 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
4528 Vim: Beendet.
4529 ]2;Terminal - Terminal]1;Terminal - Terminal
4530 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
4531 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
4532 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
4533 
4534 transaction abort!
4535 rollback completed
4536 transaction abort!
4537 rollback completed
4538 
4539 - - - - - - - - - - -  test_iteritems_1: recorded stderr - - - - - - - - - - - -
4540 transaction abort!
4541 rollback completed
4542 
4543 ________________________________________________________________________________
4544 ___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_2 ____
4545 
4546     def test_iteritems_2(self):
4547 >       self.create_rev_item_helper('abcdefghijklmn')
4548 
4549 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:210]
4550 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4551 
4552     def create_rev_item_helper(self, name):
4553         item = self.backend.create_item(name)
4554         item.create_revision(0)
4555 >       item.commit()
4556 
4557 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
4558 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4559 
4560     def commit(self):
4561         """
4562             @see: Backend._commit_item.__doc__
4563             """
4564         assert self._uncommitted_revision is not None
4565 >       self._backend._commit_item(self._uncommitted_revision)
4566 
4567 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
4568 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4569 
4570     def _commit_item(self, revision, second_parent=None):
4571         """
4572             Commit given Item Revision to repository. Update and commit Item index file.
4573             If Revision already exists, raise RevisionAlreadyExistsError.
4574             """
4575         item = revision.item
4576         lock = self._lock_repo() #XXX: lock item only!
4577         try:
4578             if not item._id:
4579                 self._add_item(item)
4580             elif revision.revno in self._list_revisions(item):
4581                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
4582     
4583             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
4584             if revision.revno > 0:
4585                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
4586                 if second_parent:
4587                     parents.append(second_parent)
4588             else:
4589                 self._open_item_index(item, 'wb').close()
4590                 self._repo.add([item._id, "%s.rev" % item._id])
4591                 parents = []
4592             internal_meta = {'rev': revision.revno,
4593                              'name': item.name,
4594                              'id': item._id,
4595                              'parents': " ".join(parents)}
4596             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
4597             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
4598     
4599             if not revision.timestamp:
4600                 revision.timestamp = long(time.time())
4601             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
4602             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
4603             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
4604             try:
4605                 match = mercurial.match.exact(self._rev_path, '', [item._id])
4606 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
4607 
4608 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
4609 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4610 
4611     def commit(self, files=None, text="", user=None, date=None,
4612                match=None, force=False, force_editor=False,
4613                p1=None, p2=None, extra={}, empty_ok=False):
4614         wlock = lock = None
4615         if extra.get("close"):
4616             force = True
4617         if files:
4618             files = util.unique(files)
4619         try:
4620             wlock = self.wlock()
4621             lock = self.lock()
4622             use_dirstate = (p1 is None) # not rawcommit
4623     
4624             if use_dirstate:
4625                 p1, p2 = self.dirstate.parents()
4626                 update_dirstate = True
4627     
4628                 if (not force and p2 != nullid and
4629                     (match and (match.files() or match.anypats()))):
4630                     raise util.Abort(_('cannot partially commit a merge '
4631                                        '(do not specify files or patterns)'))
4632     
4633                 if files:
4634                     modified, removed = [], []
4635                     for f in files:
4636                         s = self.dirstate[f]
4637                         if s in 'nma':
4638                             modified.append(f)
4639                         elif s == 'r':
4640                             removed.append(f)
4641                         else:
4642                             self.ui.warn(_("%s not tracked!\n") % f)
4643                     changes = [modified, [], removed, [], []]
4644                 else:
4645                     changes = self.status(match=match)
4646             else:
4647                 p1, p2 = p1, p2 or nullid
4648                 update_dirstate = (self.dirstate.parents()[0] == p1)
4649                 changes = [files, [], [], [], []]
4650     
4651             ms = merge_.mergestate(self)
4652             for f in changes[0]:
4653                 if f in ms and ms[f] == 'u':
4654                     raise util.Abort(_("unresolved merge conflicts "
4655                                                     "(see hg resolve)"))
4656             wctx = context.workingctx(self, (p1, p2), text, user, date,
4657                                       extra, changes)
4658             r = self._commitctx(wctx, force, force_editor, empty_ok,
4659 >                               use_dirstate, update_dirstate)
4660 
4661 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
4662 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4663 
4664     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
4665                   use_dirstate=True, update_dirstate=True):
4666         tr = None
4667         valid = 0 # don't save the dirstate if this isn't set
4668         try:
4669             commit = util.sort(wctx.modified() + wctx.added())
4670             remove = wctx.removed()
4671             extra = wctx.extra().copy()
4672             branchname = extra['branch']
4673             user = wctx.user()
4674             text = wctx.description()
4675     
4676             p1, p2 = [p.node() for p in wctx.parents()]
4677             c1 = self.changelog.read(p1)
4678             c2 = self.changelog.read(p2)
4679             m1 = self.manifest.read(c1[0]).copy()
4680             m2 = self.manifest.read(c2[0])
4681     
4682             if use_dirstate:
4683                 oldname = c1[5].get("branch") # stored in UTF-8
4684                 if (not commit and not remove and not force and p2 == nullid
4685                     and branchname == oldname):
4686                     self.ui.status(_("nothing changed\n"))
4687                     return None
4688     
4689             xp1 = hex(p1)
4690             if p2 == nullid: xp2 = ''
4691             else: xp2 = hex(p2)
4692     
4693             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
4694     
4695             tr = self.transaction()
4696             trp = weakref.proxy(tr)
4697     
4698             # check in files
4699             new = {}
4700             changed = []
4701             linkrev = len(self)
4702             for f in commit:
4703                 self.ui.note(f + "\n")
4704                 try:
4705                     fctx = wctx.filectx(f)
4706                     newflags = fctx.flags()
4707                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
4708                     if ((not changed or changed[-1] != f) and
4709                         m2.get(f) != new[f]):
4710                         # mention the file in the changelog if some
4711                         # flag changed, even if there was no content
4712                         # change.
4713                         if m1.flags(f) != newflags:
4714                             changed.append(f)
4715                     m1.set(f, newflags)
4716                     if use_dirstate:
4717                         self.dirstate.normal(f)
4718     
4719                 except (OSError, IOError):
4720                     if use_dirstate:
4721                         self.ui.warn(_("trouble committing %s!\n") % f)
4722                         raise
4723                     else:
4724                         remove.append(f)
4725     
4726             updated, added = [], []
4727             for f in util.sort(changed):
4728                 if f in m1 or f in m2:
4729                     updated.append(f)
4730                 else:
4731                     added.append(f)
4732     
4733             # update manifest
4734             m1.update(new)
4735             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
4736             removed1 = []
4737     
4738             for f in removed:
4739                 if f in m1:
4740                     del m1[f]
4741                     removed1.append(f)
4742             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
4743                                    (new, removed1))
4744     
4745             # add changeset
4746             if (not empty_ok and not text) or force_editor:
4747                 edittext = []
4748                 if text:
4749                     edittext.append(text)
4750                 edittext.append("")
4751                 edittext.append("") # Empty line between message and comments.
4752                 edittext.append(_("HG: Enter commit message."
4753                                   "  Lines beginning with 'HG:' are removed."))
4754                 edittext.append("HG: --")
4755                 edittext.append("HG: user: %s" % user)
4756                 if p2 != nullid:
4757                     edittext.append("HG: branch merge")
4758                 if branchname:
4759                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
4760                 edittext.extend(["HG: added %s" % f for f in added])
4761                 edittext.extend(["HG: changed %s" % f for f in updated])
4762                 edittext.extend(["HG: removed %s" % f for f in removed])
4763                 if not added and not updated and not removed:
4764                     edittext.append("HG: no files changed")
4765                 edittext.append("")
4766                 # run editor in the repository root
4767 E               olddir = os.getcwd()
4768 >               OSError: [Errno 2] No such file or directory
4769 
4770 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
4771 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
4772 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
4773 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
4774 HG: --
4775 HG: user: nobody
4776 HG: branch 'default'
4777 HG: added ab56b4d92b40713acc5af89985d4b786
4778 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
4779 Vim: Beendet.
4780 ]2;Terminal - Terminal]1;Terminal - Terminal
4781 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
4782 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
4783 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
4784 
4785 transaction abort!
4786 rollback completed
4787 transaction abort!
4788 rollback completed
4789 
4790 - - - - - - - - - - -  test_iteritems_2: recorded stderr - - - - - - - - - - - -
4791 transaction abort!
4792 rollback completed
4793 
4794 ________________________________________________________________________________
4795 ___ entrypoint: test_backends_hg.py TestMercurialBackend().test_iteritems_3 ____
4796 
4797     def test_iteritems_3(self):
4798 >       self.create_rev_item_helper("without_meta")
4799 
4800 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:217]
4801 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4802 
4803     def create_rev_item_helper(self, name):
4804         item = self.backend.create_item(name)
4805         item.create_revision(0)
4806 >       item.commit()
4807 
4808 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
4809 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4810 
4811     def commit(self):
4812         """
4813             @see: Backend._commit_item.__doc__
4814             """
4815         assert self._uncommitted_revision is not None
4816 >       self._backend._commit_item(self._uncommitted_revision)
4817 
4818 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
4819 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4820 
4821     def _commit_item(self, revision, second_parent=None):
4822         """
4823             Commit given Item Revision to repository. Update and commit Item index file.
4824             If Revision already exists, raise RevisionAlreadyExistsError.
4825             """
4826         item = revision.item
4827         lock = self._lock_repo() #XXX: lock item only!
4828         try:
4829             if not item._id:
4830                 self._add_item(item)
4831             elif revision.revno in self._list_revisions(item):
4832                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
4833     
4834             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
4835             if revision.revno > 0:
4836                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
4837                 if second_parent:
4838                     parents.append(second_parent)
4839             else:
4840                 self._open_item_index(item, 'wb').close()
4841                 self._repo.add([item._id, "%s.rev" % item._id])
4842                 parents = []
4843             internal_meta = {'rev': revision.revno,
4844                              'name': item.name,
4845                              'id': item._id,
4846                              'parents': " ".join(parents)}
4847             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
4848             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
4849     
4850             if not revision.timestamp:
4851                 revision.timestamp = long(time.time())
4852             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
4853             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
4854             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
4855             try:
4856                 match = mercurial.match.exact(self._rev_path, '', [item._id])
4857 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
4858 
4859 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
4860 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4861 
4862     def commit(self, files=None, text="", user=None, date=None,
4863                match=None, force=False, force_editor=False,
4864                p1=None, p2=None, extra={}, empty_ok=False):
4865         wlock = lock = None
4866         if extra.get("close"):
4867             force = True
4868         if files:
4869             files = util.unique(files)
4870         try:
4871             wlock = self.wlock()
4872             lock = self.lock()
4873             use_dirstate = (p1 is None) # not rawcommit
4874     
4875             if use_dirstate:
4876                 p1, p2 = self.dirstate.parents()
4877                 update_dirstate = True
4878     
4879                 if (not force and p2 != nullid and
4880                     (match and (match.files() or match.anypats()))):
4881                     raise util.Abort(_('cannot partially commit a merge '
4882                                        '(do not specify files or patterns)'))
4883     
4884                 if files:
4885                     modified, removed = [], []
4886                     for f in files:
4887                         s = self.dirstate[f]
4888                         if s in 'nma':
4889                             modified.append(f)
4890                         elif s == 'r':
4891                             removed.append(f)
4892                         else:
4893                             self.ui.warn(_("%s not tracked!\n") % f)
4894                     changes = [modified, [], removed, [], []]
4895                 else:
4896                     changes = self.status(match=match)
4897             else:
4898                 p1, p2 = p1, p2 or nullid
4899                 update_dirstate = (self.dirstate.parents()[0] == p1)
4900                 changes = [files, [], [], [], []]
4901     
4902             ms = merge_.mergestate(self)
4903             for f in changes[0]:
4904                 if f in ms and ms[f] == 'u':
4905                     raise util.Abort(_("unresolved merge conflicts "
4906                                                     "(see hg resolve)"))
4907             wctx = context.workingctx(self, (p1, p2), text, user, date,
4908                                       extra, changes)
4909             r = self._commitctx(wctx, force, force_editor, empty_ok,
4910 >                               use_dirstate, update_dirstate)
4911 
4912 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
4913 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
4914 
4915     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
4916                   use_dirstate=True, update_dirstate=True):
4917         tr = None
4918         valid = 0 # don't save the dirstate if this isn't set
4919         try:
4920             commit = util.sort(wctx.modified() + wctx.added())
4921             remove = wctx.removed()
4922             extra = wctx.extra().copy()
4923             branchname = extra['branch']
4924             user = wctx.user()
4925             text = wctx.description()
4926     
4927             p1, p2 = [p.node() for p in wctx.parents()]
4928             c1 = self.changelog.read(p1)
4929             c2 = self.changelog.read(p2)
4930             m1 = self.manifest.read(c1[0]).copy()
4931             m2 = self.manifest.read(c2[0])
4932     
4933             if use_dirstate:
4934                 oldname = c1[5].get("branch") # stored in UTF-8
4935                 if (not commit and not remove and not force and p2 == nullid
4936                     and branchname == oldname):
4937                     self.ui.status(_("nothing changed\n"))
4938                     return None
4939     
4940             xp1 = hex(p1)
4941             if p2 == nullid: xp2 = ''
4942             else: xp2 = hex(p2)
4943     
4944             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
4945     
4946             tr = self.transaction()
4947             trp = weakref.proxy(tr)
4948     
4949             # check in files
4950             new = {}
4951             changed = []
4952             linkrev = len(self)
4953             for f in commit:
4954                 self.ui.note(f + "\n")
4955                 try:
4956                     fctx = wctx.filectx(f)
4957                     newflags = fctx.flags()
4958                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
4959                     if ((not changed or changed[-1] != f) and
4960                         m2.get(f) != new[f]):
4961                         # mention the file in the changelog if some
4962                         # flag changed, even if there was no content
4963                         # change.
4964                         if m1.flags(f) != newflags:
4965                             changed.append(f)
4966                     m1.set(f, newflags)
4967                     if use_dirstate:
4968                         self.dirstate.normal(f)
4969     
4970                 except (OSError, IOError):
4971                     if use_dirstate:
4972                         self.ui.warn(_("trouble committing %s!\n") % f)
4973                         raise
4974                     else:
4975                         remove.append(f)
4976     
4977             updated, added = [], []
4978             for f in util.sort(changed):
4979                 if f in m1 or f in m2:
4980                     updated.append(f)
4981                 else:
4982                     added.append(f)
4983     
4984             # update manifest
4985             m1.update(new)
4986             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
4987             removed1 = []
4988     
4989             for f in removed:
4990                 if f in m1:
4991                     del m1[f]
4992                     removed1.append(f)
4993             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
4994                                    (new, removed1))
4995     
4996             # add changeset
4997             if (not empty_ok and not text) or force_editor:
4998                 edittext = []
4999                 if text:
5000                     edittext.append(text)
5001                 edittext.append("")
5002                 edittext.append("") # Empty line between message and comments.
5003                 edittext.append(_("HG: Enter commit message."
5004                                   "  Lines beginning with 'HG:' are removed."))
5005                 edittext.append("HG: --")
5006                 edittext.append("HG: user: %s" % user)
5007                 if p2 != nullid:
5008                     edittext.append("HG: branch merge")
5009                 if branchname:
5010                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
5011                 edittext.extend(["HG: added %s" % f for f in added])
5012                 edittext.extend(["HG: changed %s" % f for f in updated])
5013                 edittext.extend(["HG: removed %s" % f for f in removed])
5014                 if not added and not updated and not removed:
5015                     edittext.append("HG: no files changed")
5016                 edittext.append("")
5017                 # run editor in the repository root
5018 E               olddir = os.getcwd()
5019 >               OSError: [Errno 2] No such file or directory
5020 
5021 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
5022 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
5023 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
5024 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
5025 HG: --
5026 HG: user: nobody
5027 HG: branch 'default'
5028 HG: added ab56b4d92b40713acc5af89985d4b786
5029 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
5030 Vim: Beendet.
5031 ]2;Terminal - Terminal]1;Terminal - Terminal
5032 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
5033 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
5034 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
5035 
5036 transaction abort!
5037 rollback completed
5038 transaction abort!
5039 rollback completed
5040 
5041 - - - - - - - - - - -  test_iteritems_3: recorded stderr - - - - - - - - - - - -
5042 transaction abort!
5043 rollback completed
5044 
5045 ________________________________________________________________________________
5046  entrypoint: test_backends_hg.py TestMercurialBackend().test_existing_item_create_revision 
5047 
5048     def test_existing_item_create_revision(self):
5049 >       self.create_rev_item_helper("existing")
5050 
5051 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:227]
5052 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5053 
5054     def create_rev_item_helper(self, name):
5055         item = self.backend.create_item(name)
5056         item.create_revision(0)
5057 >       item.commit()
5058 
5059 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
5060 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5061 
5062     def commit(self):
5063         """
5064             @see: Backend._commit_item.__doc__
5065             """
5066         assert self._uncommitted_revision is not None
5067 >       self._backend._commit_item(self._uncommitted_revision)
5068 
5069 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
5070 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5071 
5072     def _commit_item(self, revision, second_parent=None):
5073         """
5074             Commit given Item Revision to repository. Update and commit Item index file.
5075             If Revision already exists, raise RevisionAlreadyExistsError.
5076             """
5077         item = revision.item
5078         lock = self._lock_repo() #XXX: lock item only!
5079         try:
5080             if not item._id:
5081                 self._add_item(item)
5082             elif revision.revno in self._list_revisions(item):
5083                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
5084     
5085             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
5086             if revision.revno > 0:
5087                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
5088                 if second_parent:
5089                     parents.append(second_parent)
5090             else:
5091                 self._open_item_index(item, 'wb').close()
5092                 self._repo.add([item._id, "%s.rev" % item._id])
5093                 parents = []
5094             internal_meta = {'rev': revision.revno,
5095                              'name': item.name,
5096                              'id': item._id,
5097                              'parents': " ".join(parents)}
5098             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
5099             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
5100     
5101             if not revision.timestamp:
5102                 revision.timestamp = long(time.time())
5103             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
5104             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
5105             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
5106             try:
5107                 match = mercurial.match.exact(self._rev_path, '', [item._id])
5108 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
5109 
5110 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
5111 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5112 
5113     def commit(self, files=None, text="", user=None, date=None,
5114                match=None, force=False, force_editor=False,
5115                p1=None, p2=None, extra={}, empty_ok=False):
5116         wlock = lock = None
5117         if extra.get("close"):
5118             force = True
5119         if files:
5120             files = util.unique(files)
5121         try:
5122             wlock = self.wlock()
5123             lock = self.lock()
5124             use_dirstate = (p1 is None) # not rawcommit
5125     
5126             if use_dirstate:
5127                 p1, p2 = self.dirstate.parents()
5128                 update_dirstate = True
5129     
5130                 if (not force and p2 != nullid and
5131                     (match and (match.files() or match.anypats()))):
5132                     raise util.Abort(_('cannot partially commit a merge '
5133                                        '(do not specify files or patterns)'))
5134     
5135                 if files:
5136                     modified, removed = [], []
5137                     for f in files:
5138                         s = self.dirstate[f]
5139                         if s in 'nma':
5140                             modified.append(f)
5141                         elif s == 'r':
5142                             removed.append(f)
5143                         else:
5144                             self.ui.warn(_("%s not tracked!\n") % f)
5145                     changes = [modified, [], removed, [], []]
5146                 else:
5147                     changes = self.status(match=match)
5148             else:
5149                 p1, p2 = p1, p2 or nullid
5150                 update_dirstate = (self.dirstate.parents()[0] == p1)
5151                 changes = [files, [], [], [], []]
5152     
5153             ms = merge_.mergestate(self)
5154             for f in changes[0]:
5155                 if f in ms and ms[f] == 'u':
5156                     raise util.Abort(_("unresolved merge conflicts "
5157                                                     "(see hg resolve)"))
5158             wctx = context.workingctx(self, (p1, p2), text, user, date,
5159                                       extra, changes)
5160             r = self._commitctx(wctx, force, force_editor, empty_ok,
5161 >                               use_dirstate, update_dirstate)
5162 
5163 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
5164 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5165 
5166     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
5167                   use_dirstate=True, update_dirstate=True):
5168         tr = None
5169         valid = 0 # don't save the dirstate if this isn't set
5170         try:
5171             commit = util.sort(wctx.modified() + wctx.added())
5172             remove = wctx.removed()
5173             extra = wctx.extra().copy()
5174             branchname = extra['branch']
5175             user = wctx.user()
5176             text = wctx.description()
5177     
5178             p1, p2 = [p.node() for p in wctx.parents()]
5179             c1 = self.changelog.read(p1)
5180             c2 = self.changelog.read(p2)
5181             m1 = self.manifest.read(c1[0]).copy()
5182             m2 = self.manifest.read(c2[0])
5183     
5184             if use_dirstate:
5185                 oldname = c1[5].get("branch") # stored in UTF-8
5186                 if (not commit and not remove and not force and p2 == nullid
5187                     and branchname == oldname):
5188                     self.ui.status(_("nothing changed\n"))
5189                     return None
5190     
5191             xp1 = hex(p1)
5192             if p2 == nullid: xp2 = ''
5193             else: xp2 = hex(p2)
5194     
5195             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
5196     
5197             tr = self.transaction()
5198             trp = weakref.proxy(tr)
5199     
5200             # check in files
5201             new = {}
5202             changed = []
5203             linkrev = len(self)
5204             for f in commit:
5205                 self.ui.note(f + "\n")
5206                 try:
5207                     fctx = wctx.filectx(f)
5208                     newflags = fctx.flags()
5209                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
5210                     if ((not changed or changed[-1] != f) and
5211                         m2.get(f) != new[f]):
5212                         # mention the file in the changelog if some
5213                         # flag changed, even if there was no content
5214                         # change.
5215                         if m1.flags(f) != newflags:
5216                             changed.append(f)
5217                     m1.set(f, newflags)
5218                     if use_dirstate:
5219                         self.dirstate.normal(f)
5220     
5221                 except (OSError, IOError):
5222                     if use_dirstate:
5223                         self.ui.warn(_("trouble committing %s!\n") % f)
5224                         raise
5225                     else:
5226                         remove.append(f)
5227     
5228             updated, added = [], []
5229             for f in util.sort(changed):
5230                 if f in m1 or f in m2:
5231                     updated.append(f)
5232                 else:
5233                     added.append(f)
5234     
5235             # update manifest
5236             m1.update(new)
5237             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
5238             removed1 = []
5239     
5240             for f in removed:
5241                 if f in m1:
5242                     del m1[f]
5243                     removed1.append(f)
5244             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
5245                                    (new, removed1))
5246     
5247             # add changeset
5248             if (not empty_ok and not text) or force_editor:
5249                 edittext = []
5250                 if text:
5251                     edittext.append(text)
5252                 edittext.append("")
5253                 edittext.append("") # Empty line between message and comments.
5254                 edittext.append(_("HG: Enter commit message."
5255                                   "  Lines beginning with 'HG:' are removed."))
5256                 edittext.append("HG: --")
5257                 edittext.append("HG: user: %s" % user)
5258                 if p2 != nullid:
5259                     edittext.append("HG: branch merge")
5260                 if branchname:
5261                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
5262                 edittext.extend(["HG: added %s" % f for f in added])
5263                 edittext.extend(["HG: changed %s" % f for f in updated])
5264                 edittext.extend(["HG: removed %s" % f for f in removed])
5265                 if not added and not updated and not removed:
5266                     edittext.append("HG: no files changed")
5267                 edittext.append("")
5268                 # run editor in the repository root
5269 E               olddir = os.getcwd()
5270 >               OSError: [Errno 2] No such file or directory
5271 
5272 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
5273 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
5274 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
5275 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
5276 HG: --
5277 HG: user: nobody
5278 HG: branch 'default'
5279 HG: added ab56b4d92b40713acc5af89985d4b786
5280 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
5281 Vim: Beendet.
5282 ]2;Terminal - Terminal]1;Terminal - Terminal
5283 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
5284 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
5285 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
5286 
5287 transaction abort!
5288 rollback completed
5289 transaction abort!
5290 rollback completed
5291 
5292 - - - - - -  test_existing_item_create_revision: recorded stderr - - - - - - -
5293 transaction abort!
5294 rollback completed
5295 
5296 ________________________________________________________________________________
5297  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_commit_revision 
5298 
5299     def test_item_commit_revision(self):
5300         item = self.backend.create_item("item#11")
5301         rev = item.create_revision(0)
5302         rev.write("python rocks")
5303 >       item.commit()
5304 
5305 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:252]
5306 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5307 
5308     def commit(self):
5309         """
5310             @see: Backend._commit_item.__doc__
5311             """
5312         assert self._uncommitted_revision is not None
5313 >       self._backend._commit_item(self._uncommitted_revision)
5314 
5315 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
5316 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5317 
5318     def _commit_item(self, revision, second_parent=None):
5319         """
5320             Commit given Item Revision to repository. Update and commit Item index file.
5321             If Revision already exists, raise RevisionAlreadyExistsError.
5322             """
5323         item = revision.item
5324         lock = self._lock_repo() #XXX: lock item only!
5325         try:
5326             if not item._id:
5327                 self._add_item(item)
5328             elif revision.revno in self._list_revisions(item):
5329                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
5330     
5331             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
5332             if revision.revno > 0:
5333                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
5334                 if second_parent:
5335                     parents.append(second_parent)
5336             else:
5337                 self._open_item_index(item, 'wb').close()
5338                 self._repo.add([item._id, "%s.rev" % item._id])
5339                 parents = []
5340             internal_meta = {'rev': revision.revno,
5341                              'name': item.name,
5342                              'id': item._id,
5343                              'parents': " ".join(parents)}
5344             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
5345             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
5346     
5347             if not revision.timestamp:
5348                 revision.timestamp = long(time.time())
5349             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
5350             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
5351             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
5352             try:
5353                 match = mercurial.match.exact(self._rev_path, '', [item._id])
5354 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
5355 
5356 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
5357 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5358 
5359     def commit(self, files=None, text="", user=None, date=None,
5360                match=None, force=False, force_editor=False,
5361                p1=None, p2=None, extra={}, empty_ok=False):
5362         wlock = lock = None
5363         if extra.get("close"):
5364             force = True
5365         if files:
5366             files = util.unique(files)
5367         try:
5368             wlock = self.wlock()
5369             lock = self.lock()
5370             use_dirstate = (p1 is None) # not rawcommit
5371     
5372             if use_dirstate:
5373                 p1, p2 = self.dirstate.parents()
5374                 update_dirstate = True
5375     
5376                 if (not force and p2 != nullid and
5377                     (match and (match.files() or match.anypats()))):
5378                     raise util.Abort(_('cannot partially commit a merge '
5379                                        '(do not specify files or patterns)'))
5380     
5381                 if files:
5382                     modified, removed = [], []
5383                     for f in files:
5384                         s = self.dirstate[f]
5385                         if s in 'nma':
5386                             modified.append(f)
5387                         elif s == 'r':
5388                             removed.append(f)
5389                         else:
5390                             self.ui.warn(_("%s not tracked!\n") % f)
5391                     changes = [modified, [], removed, [], []]
5392                 else:
5393                     changes = self.status(match=match)
5394             else:
5395                 p1, p2 = p1, p2 or nullid
5396                 update_dirstate = (self.dirstate.parents()[0] == p1)
5397                 changes = [files, [], [], [], []]
5398     
5399             ms = merge_.mergestate(self)
5400             for f in changes[0]:
5401                 if f in ms and ms[f] == 'u':
5402                     raise util.Abort(_("unresolved merge conflicts "
5403                                                     "(see hg resolve)"))
5404             wctx = context.workingctx(self, (p1, p2), text, user, date,
5405                                       extra, changes)
5406             r = self._commitctx(wctx, force, force_editor, empty_ok,
5407 >                               use_dirstate, update_dirstate)
5408 
5409 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
5410 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5411 
5412     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
5413                   use_dirstate=True, update_dirstate=True):
5414         tr = None
5415         valid = 0 # don't save the dirstate if this isn't set
5416         try:
5417             commit = util.sort(wctx.modified() + wctx.added())
5418             remove = wctx.removed()
5419             extra = wctx.extra().copy()
5420             branchname = extra['branch']
5421             user = wctx.user()
5422             text = wctx.description()
5423     
5424             p1, p2 = [p.node() for p in wctx.parents()]
5425             c1 = self.changelog.read(p1)
5426             c2 = self.changelog.read(p2)
5427             m1 = self.manifest.read(c1[0]).copy()
5428             m2 = self.manifest.read(c2[0])
5429     
5430             if use_dirstate:
5431                 oldname = c1[5].get("branch") # stored in UTF-8
5432                 if (not commit and not remove and not force and p2 == nullid
5433                     and branchname == oldname):
5434                     self.ui.status(_("nothing changed\n"))
5435                     return None
5436     
5437             xp1 = hex(p1)
5438             if p2 == nullid: xp2 = ''
5439             else: xp2 = hex(p2)
5440     
5441             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
5442     
5443             tr = self.transaction()
5444             trp = weakref.proxy(tr)
5445     
5446             # check in files
5447             new = {}
5448             changed = []
5449             linkrev = len(self)
5450             for f in commit:
5451                 self.ui.note(f + "\n")
5452                 try:
5453                     fctx = wctx.filectx(f)
5454                     newflags = fctx.flags()
5455                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
5456                     if ((not changed or changed[-1] != f) and
5457                         m2.get(f) != new[f]):
5458                         # mention the file in the changelog if some
5459                         # flag changed, even if there was no content
5460                         # change.
5461                         if m1.flags(f) != newflags:
5462                             changed.append(f)
5463                     m1.set(f, newflags)
5464                     if use_dirstate:
5465                         self.dirstate.normal(f)
5466     
5467                 except (OSError, IOError):
5468                     if use_dirstate:
5469                         self.ui.warn(_("trouble committing %s!\n") % f)
5470                         raise
5471                     else:
5472                         remove.append(f)
5473     
5474             updated, added = [], []
5475             for f in util.sort(changed):
5476                 if f in m1 or f in m2:
5477                     updated.append(f)
5478                 else:
5479                     added.append(f)
5480     
5481             # update manifest
5482             m1.update(new)
5483             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
5484             removed1 = []
5485     
5486             for f in removed:
5487                 if f in m1:
5488                     del m1[f]
5489                     removed1.append(f)
5490             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
5491                                    (new, removed1))
5492     
5493             # add changeset
5494             if (not empty_ok and not text) or force_editor:
5495                 edittext = []
5496                 if text:
5497                     edittext.append(text)
5498                 edittext.append("")
5499                 edittext.append("") # Empty line between message and comments.
5500                 edittext.append(_("HG: Enter commit message."
5501                                   "  Lines beginning with 'HG:' are removed."))
5502                 edittext.append("HG: --")
5503                 edittext.append("HG: user: %s" % user)
5504                 if p2 != nullid:
5505                     edittext.append("HG: branch merge")
5506                 if branchname:
5507                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
5508                 edittext.extend(["HG: added %s" % f for f in added])
5509                 edittext.extend(["HG: changed %s" % f for f in updated])
5510                 edittext.extend(["HG: removed %s" % f for f in removed])
5511                 if not added and not updated and not removed:
5512                     edittext.append("HG: no files changed")
5513                 edittext.append("")
5514                 # run editor in the repository root
5515 E               olddir = os.getcwd()
5516 >               OSError: [Errno 2] No such file or directory
5517 
5518 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
5519 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
5520 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
5521 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
5522 HG: --
5523 HG: user: nobody
5524 HG: branch 'default'
5525 HG: added ab56b4d92b40713acc5af89985d4b786
5526 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
5527 Vim: Beendet.
5528 ]2;Terminal - Terminal]1;Terminal - Terminal
5529 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
5530 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
5531 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
5532 
5533 transaction abort!
5534 rollback completed
5535 transaction abort!
5536 rollback completed
5537 
5538 - - - - - - - - -  test_item_commit_revision: recorded stderr - - - - - - - - - 
5539 transaction abort!
5540 rollback completed
5541 
5542 ________________________________________________________________________________
5543  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_writing_data_multiple_times 
5544 
5545     def test_item_writing_data_multiple_times(self):
5546         item = self.backend.create_item("multiple")
5547         rev = item.create_revision(0)
5548         rev.write("Alle ")
5549         rev.write("meine ")
5550         rev.write("Entchen")
5551 >       item.commit()
5552 
5553 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:262]
5554 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5555 
5556     def commit(self):
5557         """
5558             @see: Backend._commit_item.__doc__
5559             """
5560         assert self._uncommitted_revision is not None
5561 >       self._backend._commit_item(self._uncommitted_revision)
5562 
5563 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
5564 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5565 
5566     def _commit_item(self, revision, second_parent=None):
5567         """
5568             Commit given Item Revision to repository. Update and commit Item index file.
5569             If Revision already exists, raise RevisionAlreadyExistsError.
5570             """
5571         item = revision.item
5572         lock = self._lock_repo() #XXX: lock item only!
5573         try:
5574             if not item._id:
5575                 self._add_item(item)
5576             elif revision.revno in self._list_revisions(item):
5577                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
5578     
5579             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
5580             if revision.revno > 0:
5581                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
5582                 if second_parent:
5583                     parents.append(second_parent)
5584             else:
5585                 self._open_item_index(item, 'wb').close()
5586                 self._repo.add([item._id, "%s.rev" % item._id])
5587                 parents = []
5588             internal_meta = {'rev': revision.revno,
5589                              'name': item.name,
5590                              'id': item._id,
5591                              'parents': " ".join(parents)}
5592             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
5593             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
5594     
5595             if not revision.timestamp:
5596                 revision.timestamp = long(time.time())
5597             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
5598             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
5599             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
5600             try:
5601                 match = mercurial.match.exact(self._rev_path, '', [item._id])
5602 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
5603 
5604 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
5605 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5606 
5607     def commit(self, files=None, text="", user=None, date=None,
5608                match=None, force=False, force_editor=False,
5609                p1=None, p2=None, extra={}, empty_ok=False):
5610         wlock = lock = None
5611         if extra.get("close"):
5612             force = True
5613         if files:
5614             files = util.unique(files)
5615         try:
5616             wlock = self.wlock()
5617             lock = self.lock()
5618             use_dirstate = (p1 is None) # not rawcommit
5619     
5620             if use_dirstate:
5621                 p1, p2 = self.dirstate.parents()
5622                 update_dirstate = True
5623     
5624                 if (not force and p2 != nullid and
5625                     (match and (match.files() or match.anypats()))):
5626                     raise util.Abort(_('cannot partially commit a merge '
5627                                        '(do not specify files or patterns)'))
5628     
5629                 if files:
5630                     modified, removed = [], []
5631                     for f in files:
5632                         s = self.dirstate[f]
5633                         if s in 'nma':
5634                             modified.append(f)
5635                         elif s == 'r':
5636                             removed.append(f)
5637                         else:
5638                             self.ui.warn(_("%s not tracked!\n") % f)
5639                     changes = [modified, [], removed, [], []]
5640                 else:
5641                     changes = self.status(match=match)
5642             else:
5643                 p1, p2 = p1, p2 or nullid
5644                 update_dirstate = (self.dirstate.parents()[0] == p1)
5645                 changes = [files, [], [], [], []]
5646     
5647             ms = merge_.mergestate(self)
5648             for f in changes[0]:
5649                 if f in ms and ms[f] == 'u':
5650                     raise util.Abort(_("unresolved merge conflicts "
5651                                                     "(see hg resolve)"))
5652             wctx = context.workingctx(self, (p1, p2), text, user, date,
5653                                       extra, changes)
5654             r = self._commitctx(wctx, force, force_editor, empty_ok,
5655 >                               use_dirstate, update_dirstate)
5656 
5657 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
5658 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5659 
5660     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
5661                   use_dirstate=True, update_dirstate=True):
5662         tr = None
5663         valid = 0 # don't save the dirstate if this isn't set
5664         try:
5665             commit = util.sort(wctx.modified() + wctx.added())
5666             remove = wctx.removed()
5667             extra = wctx.extra().copy()
5668             branchname = extra['branch']
5669             user = wctx.user()
5670             text = wctx.description()
5671     
5672             p1, p2 = [p.node() for p in wctx.parents()]
5673             c1 = self.changelog.read(p1)
5674             c2 = self.changelog.read(p2)
5675             m1 = self.manifest.read(c1[0]).copy()
5676             m2 = self.manifest.read(c2[0])
5677     
5678             if use_dirstate:
5679                 oldname = c1[5].get("branch") # stored in UTF-8
5680                 if (not commit and not remove and not force and p2 == nullid
5681                     and branchname == oldname):
5682                     self.ui.status(_("nothing changed\n"))
5683                     return None
5684     
5685             xp1 = hex(p1)
5686             if p2 == nullid: xp2 = ''
5687             else: xp2 = hex(p2)
5688     
5689             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
5690     
5691             tr = self.transaction()
5692             trp = weakref.proxy(tr)
5693     
5694             # check in files
5695             new = {}
5696             changed = []
5697             linkrev = len(self)
5698             for f in commit:
5699                 self.ui.note(f + "\n")
5700                 try:
5701                     fctx = wctx.filectx(f)
5702                     newflags = fctx.flags()
5703                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
5704                     if ((not changed or changed[-1] != f) and
5705                         m2.get(f) != new[f]):
5706                         # mention the file in the changelog if some
5707                         # flag changed, even if there was no content
5708                         # change.
5709                         if m1.flags(f) != newflags:
5710                             changed.append(f)
5711                     m1.set(f, newflags)
5712                     if use_dirstate:
5713                         self.dirstate.normal(f)
5714     
5715                 except (OSError, IOError):
5716                     if use_dirstate:
5717                         self.ui.warn(_("trouble committing %s!\n") % f)
5718                         raise
5719                     else:
5720                         remove.append(f)
5721     
5722             updated, added = [], []
5723             for f in util.sort(changed):
5724                 if f in m1 or f in m2:
5725                     updated.append(f)
5726                 else:
5727                     added.append(f)
5728     
5729             # update manifest
5730             m1.update(new)
5731             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
5732             removed1 = []
5733     
5734             for f in removed:
5735                 if f in m1:
5736                     del m1[f]
5737                     removed1.append(f)
5738             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
5739                                    (new, removed1))
5740     
5741             # add changeset
5742             if (not empty_ok and not text) or force_editor:
5743                 edittext = []
5744                 if text:
5745                     edittext.append(text)
5746                 edittext.append("")
5747                 edittext.append("") # Empty line between message and comments.
5748                 edittext.append(_("HG: Enter commit message."
5749                                   "  Lines beginning with 'HG:' are removed."))
5750                 edittext.append("HG: --")
5751                 edittext.append("HG: user: %s" % user)
5752                 if p2 != nullid:
5753                     edittext.append("HG: branch merge")
5754                 if branchname:
5755                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
5756                 edittext.extend(["HG: added %s" % f for f in added])
5757                 edittext.extend(["HG: changed %s" % f for f in updated])
5758                 edittext.extend(["HG: removed %s" % f for f in removed])
5759                 if not added and not updated and not removed:
5760                     edittext.append("HG: no files changed")
5761                 edittext.append("")
5762                 # run editor in the repository root
5763 E               olddir = os.getcwd()
5764 >               OSError: [Errno 2] No such file or directory
5765 
5766 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
5767 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
5768 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
5769 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
5770 HG: --
5771 HG: user: nobody
5772 HG: branch 'default'
5773 HG: added ab56b4d92b40713acc5af89985d4b786
5774 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
5775 Vim: Beendet.
5776 ]2;Terminal - Terminal]1;Terminal - Terminal
5777 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
5778 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
5779 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
5780 
5781 transaction abort!
5782 rollback completed
5783 transaction abort!
5784 rollback completed
5785 
5786 - - - - - -  test_item_writing_data_multiple_times: recorded stderr - - - - - - 
5787 transaction abort!
5788 rollback completed
5789 
5790 ________________________________________________________________________________
5791  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_reading_chunks 
5792 
5793     def test_item_reading_chunks(self):
5794         item = self.backend.create_item("slices")
5795         rev = item.create_revision(0)
5796         rev.write("Alle meine Entchen")
5797 >       item.commit()
5798 
5799 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:270]
5800 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5801 
5802     def commit(self):
5803         """
5804             @see: Backend._commit_item.__doc__
5805             """
5806         assert self._uncommitted_revision is not None
5807 >       self._backend._commit_item(self._uncommitted_revision)
5808 
5809 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
5810 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5811 
5812     def _commit_item(self, revision, second_parent=None):
5813         """
5814             Commit given Item Revision to repository. Update and commit Item index file.
5815             If Revision already exists, raise RevisionAlreadyExistsError.
5816             """
5817         item = revision.item
5818         lock = self._lock_repo() #XXX: lock item only!
5819         try:
5820             if not item._id:
5821                 self._add_item(item)
5822             elif revision.revno in self._list_revisions(item):
5823                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
5824     
5825             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
5826             if revision.revno > 0:
5827                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
5828                 if second_parent:
5829                     parents.append(second_parent)
5830             else:
5831                 self._open_item_index(item, 'wb').close()
5832                 self._repo.add([item._id, "%s.rev" % item._id])
5833                 parents = []
5834             internal_meta = {'rev': revision.revno,
5835                              'name': item.name,
5836                              'id': item._id,
5837                              'parents': " ".join(parents)}
5838             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
5839             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
5840     
5841             if not revision.timestamp:
5842                 revision.timestamp = long(time.time())
5843             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
5844             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
5845             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
5846             try:
5847                 match = mercurial.match.exact(self._rev_path, '', [item._id])
5848 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
5849 
5850 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
5851 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5852 
5853     def commit(self, files=None, text="", user=None, date=None,
5854                match=None, force=False, force_editor=False,
5855                p1=None, p2=None, extra={}, empty_ok=False):
5856         wlock = lock = None
5857         if extra.get("close"):
5858             force = True
5859         if files:
5860             files = util.unique(files)
5861         try:
5862             wlock = self.wlock()
5863             lock = self.lock()
5864             use_dirstate = (p1 is None) # not rawcommit
5865     
5866             if use_dirstate:
5867                 p1, p2 = self.dirstate.parents()
5868                 update_dirstate = True
5869     
5870                 if (not force and p2 != nullid and
5871                     (match and (match.files() or match.anypats()))):
5872                     raise util.Abort(_('cannot partially commit a merge '
5873                                        '(do not specify files or patterns)'))
5874     
5875                 if files:
5876                     modified, removed = [], []
5877                     for f in files:
5878                         s = self.dirstate[f]
5879                         if s in 'nma':
5880                             modified.append(f)
5881                         elif s == 'r':
5882                             removed.append(f)
5883                         else:
5884                             self.ui.warn(_("%s not tracked!\n") % f)
5885                     changes = [modified, [], removed, [], []]
5886                 else:
5887                     changes = self.status(match=match)
5888             else:
5889                 p1, p2 = p1, p2 or nullid
5890                 update_dirstate = (self.dirstate.parents()[0] == p1)
5891                 changes = [files, [], [], [], []]
5892     
5893             ms = merge_.mergestate(self)
5894             for f in changes[0]:
5895                 if f in ms and ms[f] == 'u':
5896                     raise util.Abort(_("unresolved merge conflicts "
5897                                                     "(see hg resolve)"))
5898             wctx = context.workingctx(self, (p1, p2), text, user, date,
5899                                       extra, changes)
5900             r = self._commitctx(wctx, force, force_editor, empty_ok,
5901 >                               use_dirstate, update_dirstate)
5902 
5903 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
5904 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
5905 
5906     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
5907                   use_dirstate=True, update_dirstate=True):
5908         tr = None
5909         valid = 0 # don't save the dirstate if this isn't set
5910         try:
5911             commit = util.sort(wctx.modified() + wctx.added())
5912             remove = wctx.removed()
5913             extra = wctx.extra().copy()
5914             branchname = extra['branch']
5915             user = wctx.user()
5916             text = wctx.description()
5917     
5918             p1, p2 = [p.node() for p in wctx.parents()]
5919             c1 = self.changelog.read(p1)
5920             c2 = self.changelog.read(p2)
5921             m1 = self.manifest.read(c1[0]).copy()
5922             m2 = self.manifest.read(c2[0])
5923     
5924             if use_dirstate:
5925                 oldname = c1[5].get("branch") # stored in UTF-8
5926                 if (not commit and not remove and not force and p2 == nullid
5927                     and branchname == oldname):
5928                     self.ui.status(_("nothing changed\n"))
5929                     return None
5930     
5931             xp1 = hex(p1)
5932             if p2 == nullid: xp2 = ''
5933             else: xp2 = hex(p2)
5934     
5935             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
5936     
5937             tr = self.transaction()
5938             trp = weakref.proxy(tr)
5939     
5940             # check in files
5941             new = {}
5942             changed = []
5943             linkrev = len(self)
5944             for f in commit:
5945                 self.ui.note(f + "\n")
5946                 try:
5947                     fctx = wctx.filectx(f)
5948                     newflags = fctx.flags()
5949                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
5950                     if ((not changed or changed[-1] != f) and
5951                         m2.get(f) != new[f]):
5952                         # mention the file in the changelog if some
5953                         # flag changed, even if there was no content
5954                         # change.
5955                         if m1.flags(f) != newflags:
5956                             changed.append(f)
5957                     m1.set(f, newflags)
5958                     if use_dirstate:
5959                         self.dirstate.normal(f)
5960     
5961                 except (OSError, IOError):
5962                     if use_dirstate:
5963                         self.ui.warn(_("trouble committing %s!\n") % f)
5964                         raise
5965                     else:
5966                         remove.append(f)
5967     
5968             updated, added = [], []
5969             for f in util.sort(changed):
5970                 if f in m1 or f in m2:
5971                     updated.append(f)
5972                 else:
5973                     added.append(f)
5974     
5975             # update manifest
5976             m1.update(new)
5977             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
5978             removed1 = []
5979     
5980             for f in removed:
5981                 if f in m1:
5982                     del m1[f]
5983                     removed1.append(f)
5984             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
5985                                    (new, removed1))
5986     
5987             # add changeset
5988             if (not empty_ok and not text) or force_editor:
5989                 edittext = []
5990                 if text:
5991                     edittext.append(text)
5992                 edittext.append("")
5993                 edittext.append("") # Empty line between message and comments.
5994                 edittext.append(_("HG: Enter commit message."
5995                                   "  Lines beginning with 'HG:' are removed."))
5996                 edittext.append("HG: --")
5997                 edittext.append("HG: user: %s" % user)
5998                 if p2 != nullid:
5999                     edittext.append("HG: branch merge")
6000                 if branchname:
6001                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
6002                 edittext.extend(["HG: added %s" % f for f in added])
6003                 edittext.extend(["HG: changed %s" % f for f in updated])
6004                 edittext.extend(["HG: removed %s" % f for f in removed])
6005                 if not added and not updated and not removed:
6006                     edittext.append("HG: no files changed")
6007                 edittext.append("")
6008                 # run editor in the repository root
6009 E               olddir = os.getcwd()
6010 >               OSError: [Errno 2] No such file or directory
6011 
6012 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
6013 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
6014 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
6015 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
6016 HG: --
6017 HG: user: nobody
6018 HG: branch 'default'
6019 HG: added ab56b4d92b40713acc5af89985d4b786
6020 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
6021 Vim: Beendet.
6022 ]2;Terminal - Terminal]1;Terminal - Terminal
6023 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
6024 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
6025 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
6026 
6027 transaction abort!
6028 rollback completed
6029 transaction abort!
6030 rollback completed
6031 
6032 - - - - - - - - -  test_item_reading_chunks: recorded stderr - - - - - - - - - -
6033 transaction abort!
6034 rollback completed
6035 
6036 ________________________________________________________________________________
6037  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_reading_negative_chunk 
6038 
6039     def test_item_reading_negative_chunk(self):
6040         item = self.backend.create_item("negative_chunk")
6041         rev = item.create_revision(0)
6042         rev.write("Alle meine Entchen" * 10)
6043 >       item.commit()
6044 
6045 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:283]
6046 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6047 
6048     def commit(self):
6049         """
6050             @see: Backend._commit_item.__doc__
6051             """
6052         assert self._uncommitted_revision is not None
6053 >       self._backend._commit_item(self._uncommitted_revision)
6054 
6055 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
6056 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6057 
6058     def _commit_item(self, revision, second_parent=None):
6059         """
6060             Commit given Item Revision to repository. Update and commit Item index file.
6061             If Revision already exists, raise RevisionAlreadyExistsError.
6062             """
6063         item = revision.item
6064         lock = self._lock_repo() #XXX: lock item only!
6065         try:
6066             if not item._id:
6067                 self._add_item(item)
6068             elif revision.revno in self._list_revisions(item):
6069                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
6070     
6071             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
6072             if revision.revno > 0:
6073                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
6074                 if second_parent:
6075                     parents.append(second_parent)
6076             else:
6077                 self._open_item_index(item, 'wb').close()
6078                 self._repo.add([item._id, "%s.rev" % item._id])
6079                 parents = []
6080             internal_meta = {'rev': revision.revno,
6081                              'name': item.name,
6082                              'id': item._id,
6083                              'parents': " ".join(parents)}
6084             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
6085             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
6086     
6087             if not revision.timestamp:
6088                 revision.timestamp = long(time.time())
6089             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
6090             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
6091             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
6092             try:
6093                 match = mercurial.match.exact(self._rev_path, '', [item._id])
6094 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
6095 
6096 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
6097 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6098 
6099     def commit(self, files=None, text="", user=None, date=None,
6100                match=None, force=False, force_editor=False,
6101                p1=None, p2=None, extra={}, empty_ok=False):
6102         wlock = lock = None
6103         if extra.get("close"):
6104             force = True
6105         if files:
6106             files = util.unique(files)
6107         try:
6108             wlock = self.wlock()
6109             lock = self.lock()
6110             use_dirstate = (p1 is None) # not rawcommit
6111     
6112             if use_dirstate:
6113                 p1, p2 = self.dirstate.parents()
6114                 update_dirstate = True
6115     
6116                 if (not force and p2 != nullid and
6117                     (match and (match.files() or match.anypats()))):
6118                     raise util.Abort(_('cannot partially commit a merge '
6119                                        '(do not specify files or patterns)'))
6120     
6121                 if files:
6122                     modified, removed = [], []
6123                     for f in files:
6124                         s = self.dirstate[f]
6125                         if s in 'nma':
6126                             modified.append(f)
6127                         elif s == 'r':
6128                             removed.append(f)
6129                         else:
6130                             self.ui.warn(_("%s not tracked!\n") % f)
6131                     changes = [modified, [], removed, [], []]
6132                 else:
6133                     changes = self.status(match=match)
6134             else:
6135                 p1, p2 = p1, p2 or nullid
6136                 update_dirstate = (self.dirstate.parents()[0] == p1)
6137                 changes = [files, [], [], [], []]
6138     
6139             ms = merge_.mergestate(self)
6140             for f in changes[0]:
6141                 if f in ms and ms[f] == 'u':
6142                     raise util.Abort(_("unresolved merge conflicts "
6143                                                     "(see hg resolve)"))
6144             wctx = context.workingctx(self, (p1, p2), text, user, date,
6145                                       extra, changes)
6146             r = self._commitctx(wctx, force, force_editor, empty_ok,
6147 >                               use_dirstate, update_dirstate)
6148 
6149 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
6150 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6151 
6152     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
6153                   use_dirstate=True, update_dirstate=True):
6154         tr = None
6155         valid = 0 # don't save the dirstate if this isn't set
6156         try:
6157             commit = util.sort(wctx.modified() + wctx.added())
6158             remove = wctx.removed()
6159             extra = wctx.extra().copy()
6160             branchname = extra['branch']
6161             user = wctx.user()
6162             text = wctx.description()
6163     
6164             p1, p2 = [p.node() for p in wctx.parents()]
6165             c1 = self.changelog.read(p1)
6166             c2 = self.changelog.read(p2)
6167             m1 = self.manifest.read(c1[0]).copy()
6168             m2 = self.manifest.read(c2[0])
6169     
6170             if use_dirstate:
6171                 oldname = c1[5].get("branch") # stored in UTF-8
6172                 if (not commit and not remove and not force and p2 == nullid
6173                     and branchname == oldname):
6174                     self.ui.status(_("nothing changed\n"))
6175                     return None
6176     
6177             xp1 = hex(p1)
6178             if p2 == nullid: xp2 = ''
6179             else: xp2 = hex(p2)
6180     
6181             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
6182     
6183             tr = self.transaction()
6184             trp = weakref.proxy(tr)
6185     
6186             # check in files
6187             new = {}
6188             changed = []
6189             linkrev = len(self)
6190             for f in commit:
6191                 self.ui.note(f + "\n")
6192                 try:
6193                     fctx = wctx.filectx(f)
6194                     newflags = fctx.flags()
6195                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
6196                     if ((not changed or changed[-1] != f) and
6197                         m2.get(f) != new[f]):
6198                         # mention the file in the changelog if some
6199                         # flag changed, even if there was no content
6200                         # change.
6201                         if m1.flags(f) != newflags:
6202                             changed.append(f)
6203                     m1.set(f, newflags)
6204                     if use_dirstate:
6205                         self.dirstate.normal(f)
6206     
6207                 except (OSError, IOError):
6208                     if use_dirstate:
6209                         self.ui.warn(_("trouble committing %s!\n") % f)
6210                         raise
6211                     else:
6212                         remove.append(f)
6213     
6214             updated, added = [], []
6215             for f in util.sort(changed):
6216                 if f in m1 or f in m2:
6217                     updated.append(f)
6218                 else:
6219                     added.append(f)
6220     
6221             # update manifest
6222             m1.update(new)
6223             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
6224             removed1 = []
6225     
6226             for f in removed:
6227                 if f in m1:
6228                     del m1[f]
6229                     removed1.append(f)
6230             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
6231                                    (new, removed1))
6232     
6233             # add changeset
6234             if (not empty_ok and not text) or force_editor:
6235                 edittext = []
6236                 if text:
6237                     edittext.append(text)
6238                 edittext.append("")
6239                 edittext.append("") # Empty line between message and comments.
6240                 edittext.append(_("HG: Enter commit message."
6241                                   "  Lines beginning with 'HG:' are removed."))
6242                 edittext.append("HG: --")
6243                 edittext.append("HG: user: %s" % user)
6244                 if p2 != nullid:
6245                     edittext.append("HG: branch merge")
6246                 if branchname:
6247                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
6248                 edittext.extend(["HG: added %s" % f for f in added])
6249                 edittext.extend(["HG: changed %s" % f for f in updated])
6250                 edittext.extend(["HG: removed %s" % f for f in removed])
6251                 if not added and not updated and not removed:
6252                     edittext.append("HG: no files changed")
6253                 edittext.append("")
6254                 # run editor in the repository root
6255 E               olddir = os.getcwd()
6256 >               OSError: [Errno 2] No such file or directory
6257 
6258 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
6259 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
6260 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
6261 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
6262 HG: --
6263 HG: user: nobody
6264 HG: branch 'default'
6265 HG: added ab56b4d92b40713acc5af89985d4b786
6266 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
6267 Vim: Beendet.
6268 ]2;Terminal - Terminal]1;Terminal - Terminal
6269 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
6270 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
6271 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
6272 
6273 transaction abort!
6274 rollback completed
6275 transaction abort!
6276 rollback completed
6277 
6278 - - - - - - -  test_item_reading_negative_chunk: recorded stderr - - - - - - - -
6279 transaction abort!
6280 rollback completed
6281 
6282 ________________________________________________________________________________
6283 __ entrypoint: test_backends_hg.py TestMercurialBackend().test_seek_and_tell ___
6284 
6285     def test_seek_and_tell(self):
6286         item = self.backend.create_item("seek&tell")
6287         rev = item.create_revision(0)
6288         data = "wilhelm tell seekfried what time it is"
6289         rev.write(data)
6290 >       item.commit()
6291 
6292 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:294]
6293 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6294 
6295     def commit(self):
6296         """
6297             @see: Backend._commit_item.__doc__
6298             """
6299         assert self._uncommitted_revision is not None
6300 >       self._backend._commit_item(self._uncommitted_revision)
6301 
6302 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
6303 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6304 
6305     def _commit_item(self, revision, second_parent=None):
6306         """
6307             Commit given Item Revision to repository. Update and commit Item index file.
6308             If Revision already exists, raise RevisionAlreadyExistsError.
6309             """
6310         item = revision.item
6311         lock = self._lock_repo() #XXX: lock item only!
6312         try:
6313             if not item._id:
6314                 self._add_item(item)
6315             elif revision.revno in self._list_revisions(item):
6316                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
6317     
6318             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
6319             if revision.revno > 0:
6320                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
6321                 if second_parent:
6322                     parents.append(second_parent)
6323             else:
6324                 self._open_item_index(item, 'wb').close()
6325                 self._repo.add([item._id, "%s.rev" % item._id])
6326                 parents = []
6327             internal_meta = {'rev': revision.revno,
6328                              'name': item.name,
6329                              'id': item._id,
6330                              'parents': " ".join(parents)}
6331             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
6332             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
6333     
6334             if not revision.timestamp:
6335                 revision.timestamp = long(time.time())
6336             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
6337             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
6338             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
6339             try:
6340                 match = mercurial.match.exact(self._rev_path, '', [item._id])
6341 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
6342 
6343 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
6344 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6345 
6346     def commit(self, files=None, text="", user=None, date=None,
6347                match=None, force=False, force_editor=False,
6348                p1=None, p2=None, extra={}, empty_ok=False):
6349         wlock = lock = None
6350         if extra.get("close"):
6351             force = True
6352         if files:
6353             files = util.unique(files)
6354         try:
6355             wlock = self.wlock()
6356             lock = self.lock()
6357             use_dirstate = (p1 is None) # not rawcommit
6358     
6359             if use_dirstate:
6360                 p1, p2 = self.dirstate.parents()
6361                 update_dirstate = True
6362     
6363                 if (not force and p2 != nullid and
6364                     (match and (match.files() or match.anypats()))):
6365                     raise util.Abort(_('cannot partially commit a merge '
6366                                        '(do not specify files or patterns)'))
6367     
6368                 if files:
6369                     modified, removed = [], []
6370                     for f in files:
6371                         s = self.dirstate[f]
6372                         if s in 'nma':
6373                             modified.append(f)
6374                         elif s == 'r':
6375                             removed.append(f)
6376                         else:
6377                             self.ui.warn(_("%s not tracked!\n") % f)
6378                     changes = [modified, [], removed, [], []]
6379                 else:
6380                     changes = self.status(match=match)
6381             else:
6382                 p1, p2 = p1, p2 or nullid
6383                 update_dirstate = (self.dirstate.parents()[0] == p1)
6384                 changes = [files, [], [], [], []]
6385     
6386             ms = merge_.mergestate(self)
6387             for f in changes[0]:
6388                 if f in ms and ms[f] == 'u':
6389                     raise util.Abort(_("unresolved merge conflicts "
6390                                                     "(see hg resolve)"))
6391             wctx = context.workingctx(self, (p1, p2), text, user, date,
6392                                       extra, changes)
6393             r = self._commitctx(wctx, force, force_editor, empty_ok,
6394 >                               use_dirstate, update_dirstate)
6395 
6396 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
6397 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6398 
6399     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
6400                   use_dirstate=True, update_dirstate=True):
6401         tr = None
6402         valid = 0 # don't save the dirstate if this isn't set
6403         try:
6404             commit = util.sort(wctx.modified() + wctx.added())
6405             remove = wctx.removed()
6406             extra = wctx.extra().copy()
6407             branchname = extra['branch']
6408             user = wctx.user()
6409             text = wctx.description()
6410     
6411             p1, p2 = [p.node() for p in wctx.parents()]
6412             c1 = self.changelog.read(p1)
6413             c2 = self.changelog.read(p2)
6414             m1 = self.manifest.read(c1[0]).copy()
6415             m2 = self.manifest.read(c2[0])
6416     
6417             if use_dirstate:
6418                 oldname = c1[5].get("branch") # stored in UTF-8
6419                 if (not commit and not remove and not force and p2 == nullid
6420                     and branchname == oldname):
6421                     self.ui.status(_("nothing changed\n"))
6422                     return None
6423     
6424             xp1 = hex(p1)
6425             if p2 == nullid: xp2 = ''
6426             else: xp2 = hex(p2)
6427     
6428             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
6429     
6430             tr = self.transaction()
6431             trp = weakref.proxy(tr)
6432     
6433             # check in files
6434             new = {}
6435             changed = []
6436             linkrev = len(self)
6437             for f in commit:
6438                 self.ui.note(f + "\n")
6439                 try:
6440                     fctx = wctx.filectx(f)
6441                     newflags = fctx.flags()
6442                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
6443                     if ((not changed or changed[-1] != f) and
6444                         m2.get(f) != new[f]):
6445                         # mention the file in the changelog if some
6446                         # flag changed, even if there was no content
6447                         # change.
6448                         if m1.flags(f) != newflags:
6449                             changed.append(f)
6450                     m1.set(f, newflags)
6451                     if use_dirstate:
6452                         self.dirstate.normal(f)
6453     
6454                 except (OSError, IOError):
6455                     if use_dirstate:
6456                         self.ui.warn(_("trouble committing %s!\n") % f)
6457                         raise
6458                     else:
6459                         remove.append(f)
6460     
6461             updated, added = [], []
6462             for f in util.sort(changed):
6463                 if f in m1 or f in m2:
6464                     updated.append(f)
6465                 else:
6466                     added.append(f)
6467     
6468             # update manifest
6469             m1.update(new)
6470             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
6471             removed1 = []
6472     
6473             for f in removed:
6474                 if f in m1:
6475                     del m1[f]
6476                     removed1.append(f)
6477             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
6478                                    (new, removed1))
6479     
6480             # add changeset
6481             if (not empty_ok and not text) or force_editor:
6482                 edittext = []
6483                 if text:
6484                     edittext.append(text)
6485                 edittext.append("")
6486                 edittext.append("") # Empty line between message and comments.
6487                 edittext.append(_("HG: Enter commit message."
6488                                   "  Lines beginning with 'HG:' are removed."))
6489                 edittext.append("HG: --")
6490                 edittext.append("HG: user: %s" % user)
6491                 if p2 != nullid:
6492                     edittext.append("HG: branch merge")
6493                 if branchname:
6494                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
6495                 edittext.extend(["HG: added %s" % f for f in added])
6496                 edittext.extend(["HG: changed %s" % f for f in updated])
6497                 edittext.extend(["HG: removed %s" % f for f in removed])
6498                 if not added and not updated and not removed:
6499                     edittext.append("HG: no files changed")
6500                 edittext.append("")
6501                 # run editor in the repository root
6502 E               olddir = os.getcwd()
6503 >               OSError: [Errno 2] No such file or directory
6504 
6505 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
6506 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
6507 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
6508 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
6509 HG: --
6510 HG: user: nobody
6511 HG: branch 'default'
6512 HG: added ab56b4d92b40713acc5af89985d4b786
6513 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
6514 Vim: Beendet.
6515 ]2;Terminal - Terminal]1;Terminal - Terminal
6516 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
6517 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
6518 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
6519 
6520 transaction abort!
6521 rollback completed
6522 transaction abort!
6523 rollback completed
6524 
6525 - - - - - - - - - -  test_seek_and_tell: recorded stderr - - - - - - - - - - -
6526 transaction abort!
6527 rollback completed
6528 
6529 ________________________________________________________________________________
6530  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_get_revision _
6531 
6532     def test_item_get_revision(self):
6533         item = self.backend.create_item("item#12")
6534         rev = item.create_revision(0)
6535         rev.write("jefferson airplane rocks")
6536 >       item.commit()
6537 
6538 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:319]
6539 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6540 
6541     def commit(self):
6542         """
6543             @see: Backend._commit_item.__doc__
6544             """
6545         assert self._uncommitted_revision is not None
6546 >       self._backend._commit_item(self._uncommitted_revision)
6547 
6548 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
6549 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6550 
6551     def _commit_item(self, revision, second_parent=None):
6552         """
6553             Commit given Item Revision to repository. Update and commit Item index file.
6554             If Revision already exists, raise RevisionAlreadyExistsError.
6555             """
6556         item = revision.item
6557         lock = self._lock_repo() #XXX: lock item only!
6558         try:
6559             if not item._id:
6560                 self._add_item(item)
6561             elif revision.revno in self._list_revisions(item):
6562                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
6563     
6564             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
6565             if revision.revno > 0:
6566                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
6567                 if second_parent:
6568                     parents.append(second_parent)
6569             else:
6570                 self._open_item_index(item, 'wb').close()
6571                 self._repo.add([item._id, "%s.rev" % item._id])
6572                 parents = []
6573             internal_meta = {'rev': revision.revno,
6574                              'name': item.name,
6575                              'id': item._id,
6576                              'parents': " ".join(parents)}
6577             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
6578             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
6579     
6580             if not revision.timestamp:
6581                 revision.timestamp = long(time.time())
6582             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
6583             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
6584             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
6585             try:
6586                 match = mercurial.match.exact(self._rev_path, '', [item._id])
6587 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
6588 
6589 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
6590 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6591 
6592     def commit(self, files=None, text="", user=None, date=None,
6593                match=None, force=False, force_editor=False,
6594                p1=None, p2=None, extra={}, empty_ok=False):
6595         wlock = lock = None
6596         if extra.get("close"):
6597             force = True
6598         if files:
6599             files = util.unique(files)
6600         try:
6601             wlock = self.wlock()
6602             lock = self.lock()
6603             use_dirstate = (p1 is None) # not rawcommit
6604     
6605             if use_dirstate:
6606                 p1, p2 = self.dirstate.parents()
6607                 update_dirstate = True
6608     
6609                 if (not force and p2 != nullid and
6610                     (match and (match.files() or match.anypats()))):
6611                     raise util.Abort(_('cannot partially commit a merge '
6612                                        '(do not specify files or patterns)'))
6613     
6614                 if files:
6615                     modified, removed = [], []
6616                     for f in files:
6617                         s = self.dirstate[f]
6618                         if s in 'nma':
6619                             modified.append(f)
6620                         elif s == 'r':
6621                             removed.append(f)
6622                         else:
6623                             self.ui.warn(_("%s not tracked!\n") % f)
6624                     changes = [modified, [], removed, [], []]
6625                 else:
6626                     changes = self.status(match=match)
6627             else:
6628                 p1, p2 = p1, p2 or nullid
6629                 update_dirstate = (self.dirstate.parents()[0] == p1)
6630                 changes = [files, [], [], [], []]
6631     
6632             ms = merge_.mergestate(self)
6633             for f in changes[0]:
6634                 if f in ms and ms[f] == 'u':
6635                     raise util.Abort(_("unresolved merge conflicts "
6636                                                     "(see hg resolve)"))
6637             wctx = context.workingctx(self, (p1, p2), text, user, date,
6638                                       extra, changes)
6639             r = self._commitctx(wctx, force, force_editor, empty_ok,
6640 >                               use_dirstate, update_dirstate)
6641 
6642 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
6643 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6644 
6645     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
6646                   use_dirstate=True, update_dirstate=True):
6647         tr = None
6648         valid = 0 # don't save the dirstate if this isn't set
6649         try:
6650             commit = util.sort(wctx.modified() + wctx.added())
6651             remove = wctx.removed()
6652             extra = wctx.extra().copy()
6653             branchname = extra['branch']
6654             user = wctx.user()
6655             text = wctx.description()
6656     
6657             p1, p2 = [p.node() for p in wctx.parents()]
6658             c1 = self.changelog.read(p1)
6659             c2 = self.changelog.read(p2)
6660             m1 = self.manifest.read(c1[0]).copy()
6661             m2 = self.manifest.read(c2[0])
6662     
6663             if use_dirstate:
6664                 oldname = c1[5].get("branch") # stored in UTF-8
6665                 if (not commit and not remove and not force and p2 == nullid
6666                     and branchname == oldname):
6667                     self.ui.status(_("nothing changed\n"))
6668                     return None
6669     
6670             xp1 = hex(p1)
6671             if p2 == nullid: xp2 = ''
6672             else: xp2 = hex(p2)
6673     
6674             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
6675     
6676             tr = self.transaction()
6677             trp = weakref.proxy(tr)
6678     
6679             # check in files
6680             new = {}
6681             changed = []
6682             linkrev = len(self)
6683             for f in commit:
6684                 self.ui.note(f + "\n")
6685                 try:
6686                     fctx = wctx.filectx(f)
6687                     newflags = fctx.flags()
6688                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
6689                     if ((not changed or changed[-1] != f) and
6690                         m2.get(f) != new[f]):
6691                         # mention the file in the changelog if some
6692                         # flag changed, even if there was no content
6693                         # change.
6694                         if m1.flags(f) != newflags:
6695                             changed.append(f)
6696                     m1.set(f, newflags)
6697                     if use_dirstate:
6698                         self.dirstate.normal(f)
6699     
6700                 except (OSError, IOError):
6701                     if use_dirstate:
6702                         self.ui.warn(_("trouble committing %s!\n") % f)
6703                         raise
6704                     else:
6705                         remove.append(f)
6706     
6707             updated, added = [], []
6708             for f in util.sort(changed):
6709                 if f in m1 or f in m2:
6710                     updated.append(f)
6711                 else:
6712                     added.append(f)
6713     
6714             # update manifest
6715             m1.update(new)
6716             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
6717             removed1 = []
6718     
6719             for f in removed:
6720                 if f in m1:
6721                     del m1[f]
6722                     removed1.append(f)
6723             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
6724                                    (new, removed1))
6725     
6726             # add changeset
6727             if (not empty_ok and not text) or force_editor:
6728                 edittext = []
6729                 if text:
6730                     edittext.append(text)
6731                 edittext.append("")
6732                 edittext.append("") # Empty line between message and comments.
6733                 edittext.append(_("HG: Enter commit message."
6734                                   "  Lines beginning with 'HG:' are removed."))
6735                 edittext.append("HG: --")
6736                 edittext.append("HG: user: %s" % user)
6737                 if p2 != nullid:
6738                     edittext.append("HG: branch merge")
6739                 if branchname:
6740                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
6741                 edittext.extend(["HG: added %s" % f for f in added])
6742                 edittext.extend(["HG: changed %s" % f for f in updated])
6743                 edittext.extend(["HG: removed %s" % f for f in removed])
6744                 if not added and not updated and not removed:
6745                     edittext.append("HG: no files changed")
6746                 edittext.append("")
6747                 # run editor in the repository root
6748 E               olddir = os.getcwd()
6749 >               OSError: [Errno 2] No such file or directory
6750 
6751 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
6752 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
6753 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
6754 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
6755 HG: --
6756 HG: user: nobody
6757 HG: branch 'default'
6758 HG: added ab56b4d92b40713acc5af89985d4b786
6759 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
6760 Vim: Beendet.
6761 ]2;Terminal - Terminal]1;Terminal - Terminal
6762 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
6763 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
6764 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
6765 
6766 transaction abort!
6767 rollback completed
6768 transaction abort!
6769 rollback completed
6770 
6771 - - - - - - - - -  test_item_get_revision: recorded stderr - - - - - - - - - -
6772 transaction abort!
6773 rollback completed
6774 
6775 ________________________________________________________________________________
6776 _ entrypoint: test_backends_hg.py TestMercurialBackend().test_item_next_revno __
6777 
6778     def test_item_next_revno(self):
6779         item = self.backend.create_item("next_revno")
6780         assert item.next_revno == 0
6781         item.create_revision(item.next_revno).write("foo")
6782 >       item.commit()
6783 
6784 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:327]
6785 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6786 
6787     def commit(self):
6788         """
6789             @see: Backend._commit_item.__doc__
6790             """
6791         assert self._uncommitted_revision is not None
6792 >       self._backend._commit_item(self._uncommitted_revision)
6793 
6794 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
6795 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6796 
6797     def _commit_item(self, revision, second_parent=None):
6798         """
6799             Commit given Item Revision to repository. Update and commit Item index file.
6800             If Revision already exists, raise RevisionAlreadyExistsError.
6801             """
6802         item = revision.item
6803         lock = self._lock_repo() #XXX: lock item only!
6804         try:
6805             if not item._id:
6806                 self._add_item(item)
6807             elif revision.revno in self._list_revisions(item):
6808                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
6809     
6810             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
6811             if revision.revno > 0:
6812                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
6813                 if second_parent:
6814                     parents.append(second_parent)
6815             else:
6816                 self._open_item_index(item, 'wb').close()
6817                 self._repo.add([item._id, "%s.rev" % item._id])
6818                 parents = []
6819             internal_meta = {'rev': revision.revno,
6820                              'name': item.name,
6821                              'id': item._id,
6822                              'parents': " ".join(parents)}
6823             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
6824             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
6825     
6826             if not revision.timestamp:
6827                 revision.timestamp = long(time.time())
6828             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
6829             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
6830             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
6831             try:
6832                 match = mercurial.match.exact(self._rev_path, '', [item._id])
6833 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
6834 
6835 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
6836 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6837 
6838     def commit(self, files=None, text="", user=None, date=None,
6839                match=None, force=False, force_editor=False,
6840                p1=None, p2=None, extra={}, empty_ok=False):
6841         wlock = lock = None
6842         if extra.get("close"):
6843             force = True
6844         if files:
6845             files = util.unique(files)
6846         try:
6847             wlock = self.wlock()
6848             lock = self.lock()
6849             use_dirstate = (p1 is None) # not rawcommit
6850     
6851             if use_dirstate:
6852                 p1, p2 = self.dirstate.parents()
6853                 update_dirstate = True
6854     
6855                 if (not force and p2 != nullid and
6856                     (match and (match.files() or match.anypats()))):
6857                     raise util.Abort(_('cannot partially commit a merge '
6858                                        '(do not specify files or patterns)'))
6859     
6860                 if files:
6861                     modified, removed = [], []
6862                     for f in files:
6863                         s = self.dirstate[f]
6864                         if s in 'nma':
6865                             modified.append(f)
6866                         elif s == 'r':
6867                             removed.append(f)
6868                         else:
6869                             self.ui.warn(_("%s not tracked!\n") % f)
6870                     changes = [modified, [], removed, [], []]
6871                 else:
6872                     changes = self.status(match=match)
6873             else:
6874                 p1, p2 = p1, p2 or nullid
6875                 update_dirstate = (self.dirstate.parents()[0] == p1)
6876                 changes = [files, [], [], [], []]
6877     
6878             ms = merge_.mergestate(self)
6879             for f in changes[0]:
6880                 if f in ms and ms[f] == 'u':
6881                     raise util.Abort(_("unresolved merge conflicts "
6882                                                     "(see hg resolve)"))
6883             wctx = context.workingctx(self, (p1, p2), text, user, date,
6884                                       extra, changes)
6885             r = self._commitctx(wctx, force, force_editor, empty_ok,
6886 >                               use_dirstate, update_dirstate)
6887 
6888 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
6889 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
6890 
6891     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
6892                   use_dirstate=True, update_dirstate=True):
6893         tr = None
6894         valid = 0 # don't save the dirstate if this isn't set
6895         try:
6896             commit = util.sort(wctx.modified() + wctx.added())
6897             remove = wctx.removed()
6898             extra = wctx.extra().copy()
6899             branchname = extra['branch']
6900             user = wctx.user()
6901             text = wctx.description()
6902     
6903             p1, p2 = [p.node() for p in wctx.parents()]
6904             c1 = self.changelog.read(p1)
6905             c2 = self.changelog.read(p2)
6906             m1 = self.manifest.read(c1[0]).copy()
6907             m2 = self.manifest.read(c2[0])
6908     
6909             if use_dirstate:
6910                 oldname = c1[5].get("branch") # stored in UTF-8
6911                 if (not commit and not remove and not force and p2 == nullid
6912                     and branchname == oldname):
6913                     self.ui.status(_("nothing changed\n"))
6914                     return None
6915     
6916             xp1 = hex(p1)
6917             if p2 == nullid: xp2 = ''
6918             else: xp2 = hex(p2)
6919     
6920             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
6921     
6922             tr = self.transaction()
6923             trp = weakref.proxy(tr)
6924     
6925             # check in files
6926             new = {}
6927             changed = []
6928             linkrev = len(self)
6929             for f in commit:
6930                 self.ui.note(f + "\n")
6931                 try:
6932                     fctx = wctx.filectx(f)
6933                     newflags = fctx.flags()
6934                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
6935                     if ((not changed or changed[-1] != f) and
6936                         m2.get(f) != new[f]):
6937                         # mention the file in the changelog if some
6938                         # flag changed, even if there was no content
6939                         # change.
6940                         if m1.flags(f) != newflags:
6941                             changed.append(f)
6942                     m1.set(f, newflags)
6943                     if use_dirstate:
6944                         self.dirstate.normal(f)
6945     
6946                 except (OSError, IOError):
6947                     if use_dirstate:
6948                         self.ui.warn(_("trouble committing %s!\n") % f)
6949                         raise
6950                     else:
6951                         remove.append(f)
6952     
6953             updated, added = [], []
6954             for f in util.sort(changed):
6955                 if f in m1 or f in m2:
6956                     updated.append(f)
6957                 else:
6958                     added.append(f)
6959     
6960             # update manifest
6961             m1.update(new)
6962             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
6963             removed1 = []
6964     
6965             for f in removed:
6966                 if f in m1:
6967                     del m1[f]
6968                     removed1.append(f)
6969             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
6970                                    (new, removed1))
6971     
6972             # add changeset
6973             if (not empty_ok and not text) or force_editor:
6974                 edittext = []
6975                 if text:
6976                     edittext.append(text)
6977                 edittext.append("")
6978                 edittext.append("") # Empty line between message and comments.
6979                 edittext.append(_("HG: Enter commit message."
6980                                   "  Lines beginning with 'HG:' are removed."))
6981                 edittext.append("HG: --")
6982                 edittext.append("HG: user: %s" % user)
6983                 if p2 != nullid:
6984                     edittext.append("HG: branch merge")
6985                 if branchname:
6986                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
6987                 edittext.extend(["HG: added %s" % f for f in added])
6988                 edittext.extend(["HG: changed %s" % f for f in updated])
6989                 edittext.extend(["HG: removed %s" % f for f in removed])
6990                 if not added and not updated and not removed:
6991                     edittext.append("HG: no files changed")
6992                 edittext.append("")
6993                 # run editor in the repository root
6994 E               olddir = os.getcwd()
6995 >               OSError: [Errno 2] No such file or directory
6996 
6997 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
6998 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
6999 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
7000 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
7001 HG: --
7002 HG: user: nobody
7003 HG: branch 'default'
7004 HG: added ab56b4d92b40713acc5af89985d4b786
7005 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
7006 Vim: Beendet.
7007 ]2;Terminal - Terminal]1;Terminal - Terminal
7008 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
7009 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
7010 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
7011 
7012 transaction abort!
7013 rollback completed
7014 transaction abort!
7015 rollback completed
7016 
7017 - - - - - - - - - -  test_item_next_revno: recorded stderr - - - - - - - - - - -
7018 transaction abort!
7019 rollback completed
7020 
7021 ________________________________________________________________________________
7022  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_with_revmeta_changes 
7023 
7024     def test_item_list_revisions_with_revmeta_changes(self):
7025         item = self.backend.create_item("item_13")
7026         for revno in range(0, 10):
7027             rev = item.create_revision(revno)
7028             rev["revno"] = "%s" % revno
7029 >           item.commit()
7030 
7031 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:335]
7032 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7033 
7034     def commit(self):
7035         """
7036             @see: Backend._commit_item.__doc__
7037             """
7038         assert self._uncommitted_revision is not None
7039 >       self._backend._commit_item(self._uncommitted_revision)
7040 
7041 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
7042 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7043 
7044     def _commit_item(self, revision, second_parent=None):
7045         """
7046             Commit given Item Revision to repository. Update and commit Item index file.
7047             If Revision already exists, raise RevisionAlreadyExistsError.
7048             """
7049         item = revision.item
7050         lock = self._lock_repo() #XXX: lock item only!
7051         try:
7052             if not item._id:
7053                 self._add_item(item)
7054             elif revision.revno in self._list_revisions(item):
7055                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
7056     
7057             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
7058             if revision.revno > 0:
7059                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
7060                 if second_parent:
7061                     parents.append(second_parent)
7062             else:
7063                 self._open_item_index(item, 'wb').close()
7064                 self._repo.add([item._id, "%s.rev" % item._id])
7065                 parents = []
7066             internal_meta = {'rev': revision.revno,
7067                              'name': item.name,
7068                              'id': item._id,
7069                              'parents': " ".join(parents)}
7070             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
7071             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
7072     
7073             if not revision.timestamp:
7074                 revision.timestamp = long(time.time())
7075             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
7076             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
7077             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
7078             try:
7079                 match = mercurial.match.exact(self._rev_path, '', [item._id])
7080 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
7081 
7082 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
7083 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7084 
7085     def commit(self, files=None, text="", user=None, date=None,
7086                match=None, force=False, force_editor=False,
7087                p1=None, p2=None, extra={}, empty_ok=False):
7088         wlock = lock = None
7089         if extra.get("close"):
7090             force = True
7091         if files:
7092             files = util.unique(files)
7093         try:
7094             wlock = self.wlock()
7095             lock = self.lock()
7096             use_dirstate = (p1 is None) # not rawcommit
7097     
7098             if use_dirstate:
7099                 p1, p2 = self.dirstate.parents()
7100                 update_dirstate = True
7101     
7102                 if (not force and p2 != nullid and
7103                     (match and (match.files() or match.anypats()))):
7104                     raise util.Abort(_('cannot partially commit a merge '
7105                                        '(do not specify files or patterns)'))
7106     
7107                 if files:
7108                     modified, removed = [], []
7109                     for f in files:
7110                         s = self.dirstate[f]
7111                         if s in 'nma':
7112                             modified.append(f)
7113                         elif s == 'r':
7114                             removed.append(f)
7115                         else:
7116                             self.ui.warn(_("%s not tracked!\n") % f)
7117                     changes = [modified, [], removed, [], []]
7118                 else:
7119                     changes = self.status(match=match)
7120             else:
7121                 p1, p2 = p1, p2 or nullid
7122                 update_dirstate = (self.dirstate.parents()[0] == p1)
7123                 changes = [files, [], [], [], []]
7124     
7125             ms = merge_.mergestate(self)
7126             for f in changes[0]:
7127                 if f in ms and ms[f] == 'u':
7128                     raise util.Abort(_("unresolved merge conflicts "
7129                                                     "(see hg resolve)"))
7130             wctx = context.workingctx(self, (p1, p2), text, user, date,
7131                                       extra, changes)
7132             r = self._commitctx(wctx, force, force_editor, empty_ok,
7133 >                               use_dirstate, update_dirstate)
7134 
7135 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
7136 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7137 
7138     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
7139                   use_dirstate=True, update_dirstate=True):
7140         tr = None
7141         valid = 0 # don't save the dirstate if this isn't set
7142         try:
7143             commit = util.sort(wctx.modified() + wctx.added())
7144             remove = wctx.removed()
7145             extra = wctx.extra().copy()
7146             branchname = extra['branch']
7147             user = wctx.user()
7148             text = wctx.description()
7149     
7150             p1, p2 = [p.node() for p in wctx.parents()]
7151             c1 = self.changelog.read(p1)
7152             c2 = self.changelog.read(p2)
7153             m1 = self.manifest.read(c1[0]).copy()
7154             m2 = self.manifest.read(c2[0])
7155     
7156             if use_dirstate:
7157                 oldname = c1[5].get("branch") # stored in UTF-8
7158                 if (not commit and not remove and not force and p2 == nullid
7159                     and branchname == oldname):
7160                     self.ui.status(_("nothing changed\n"))
7161                     return None
7162     
7163             xp1 = hex(p1)
7164             if p2 == nullid: xp2 = ''
7165             else: xp2 = hex(p2)
7166     
7167             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
7168     
7169             tr = self.transaction()
7170             trp = weakref.proxy(tr)
7171     
7172             # check in files
7173             new = {}
7174             changed = []
7175             linkrev = len(self)
7176             for f in commit:
7177                 self.ui.note(f + "\n")
7178                 try:
7179                     fctx = wctx.filectx(f)
7180                     newflags = fctx.flags()
7181                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
7182                     if ((not changed or changed[-1] != f) and
7183                         m2.get(f) != new[f]):
7184                         # mention the file in the changelog if some
7185                         # flag changed, even if there was no content
7186                         # change.
7187                         if m1.flags(f) != newflags:
7188                             changed.append(f)
7189                     m1.set(f, newflags)
7190                     if use_dirstate:
7191                         self.dirstate.normal(f)
7192     
7193                 except (OSError, IOError):
7194                     if use_dirstate:
7195                         self.ui.warn(_("trouble committing %s!\n") % f)
7196                         raise
7197                     else:
7198                         remove.append(f)
7199     
7200             updated, added = [], []
7201             for f in util.sort(changed):
7202                 if f in m1 or f in m2:
7203                     updated.append(f)
7204                 else:
7205                     added.append(f)
7206     
7207             # update manifest
7208             m1.update(new)
7209             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
7210             removed1 = []
7211     
7212             for f in removed:
7213                 if f in m1:
7214                     del m1[f]
7215                     removed1.append(f)
7216             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
7217                                    (new, removed1))
7218     
7219             # add changeset
7220             if (not empty_ok and not text) or force_editor:
7221                 edittext = []
7222                 if text:
7223                     edittext.append(text)
7224                 edittext.append("")
7225                 edittext.append("") # Empty line between message and comments.
7226                 edittext.append(_("HG: Enter commit message."
7227                                   "  Lines beginning with 'HG:' are removed."))
7228                 edittext.append("HG: --")
7229                 edittext.append("HG: user: %s" % user)
7230                 if p2 != nullid:
7231                     edittext.append("HG: branch merge")
7232                 if branchname:
7233                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
7234                 edittext.extend(["HG: added %s" % f for f in added])
7235                 edittext.extend(["HG: changed %s" % f for f in updated])
7236                 edittext.extend(["HG: removed %s" % f for f in removed])
7237                 if not added and not updated and not removed:
7238                     edittext.append("HG: no files changed")
7239                 edittext.append("")
7240                 # run editor in the repository root
7241 E               olddir = os.getcwd()
7242 >               OSError: [Errno 2] No such file or directory
7243 
7244 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
7245 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
7246 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
7247 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
7248 HG: --
7249 HG: user: nobody
7250 HG: branch 'default'
7251 HG: added ab56b4d92b40713acc5af89985d4b786
7252 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
7253 Vim: Beendet.
7254 ]2;Terminal - Terminal]1;Terminal - Terminal
7255 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
7256 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
7257 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
7258 
7259 transaction abort!
7260 rollback completed
7261 transaction abort!
7262 rollback completed
7263 
7264 - - - -  test_item_list_revisions_with_revmeta_changes: recorded stderr - - - - 
7265 transaction abort!
7266 rollback completed
7267 
7268 ________________________________________________________________________________
7269  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_with_revdata_changes 
7270 
7271     def test_item_list_revisions_with_revdata_changes(self):
7272         item = self.backend.create_item("item_13")
7273         for revno in range(0, 10):
7274             rev = item.create_revision(revno)
7275             rev.write("%s" % revno)
7276 >           item.commit()
7277 
7278 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:343]
7279 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7280 
7281     def commit(self):
7282         """
7283             @see: Backend._commit_item.__doc__
7284             """
7285         assert self._uncommitted_revision is not None
7286 >       self._backend._commit_item(self._uncommitted_revision)
7287 
7288 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
7289 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7290 
7291     def _commit_item(self, revision, second_parent=None):
7292         """
7293             Commit given Item Revision to repository. Update and commit Item index file.
7294             If Revision already exists, raise RevisionAlreadyExistsError.
7295             """
7296         item = revision.item
7297         lock = self._lock_repo() #XXX: lock item only!
7298         try:
7299             if not item._id:
7300                 self._add_item(item)
7301             elif revision.revno in self._list_revisions(item):
7302                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
7303     
7304             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
7305             if revision.revno > 0:
7306                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
7307                 if second_parent:
7308                     parents.append(second_parent)
7309             else:
7310                 self._open_item_index(item, 'wb').close()
7311                 self._repo.add([item._id, "%s.rev" % item._id])
7312                 parents = []
7313             internal_meta = {'rev': revision.revno,
7314                              'name': item.name,
7315                              'id': item._id,
7316                              'parents': " ".join(parents)}
7317             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
7318             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
7319     
7320             if not revision.timestamp:
7321                 revision.timestamp = long(time.time())
7322             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
7323             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
7324             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
7325             try:
7326                 match = mercurial.match.exact(self._rev_path, '', [item._id])
7327 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
7328 
7329 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
7330 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7331 
7332     def commit(self, files=None, text="", user=None, date=None,
7333                match=None, force=False, force_editor=False,
7334                p1=None, p2=None, extra={}, empty_ok=False):
7335         wlock = lock = None
7336         if extra.get("close"):
7337             force = True
7338         if files:
7339             files = util.unique(files)
7340         try:
7341             wlock = self.wlock()
7342             lock = self.lock()
7343             use_dirstate = (p1 is None) # not rawcommit
7344     
7345             if use_dirstate:
7346                 p1, p2 = self.dirstate.parents()
7347                 update_dirstate = True
7348     
7349                 if (not force and p2 != nullid and
7350                     (match and (match.files() or match.anypats()))):
7351                     raise util.Abort(_('cannot partially commit a merge '
7352                                        '(do not specify files or patterns)'))
7353     
7354                 if files:
7355                     modified, removed = [], []
7356                     for f in files:
7357                         s = self.dirstate[f]
7358                         if s in 'nma':
7359                             modified.append(f)
7360                         elif s == 'r':
7361                             removed.append(f)
7362                         else:
7363                             self.ui.warn(_("%s not tracked!\n") % f)
7364                     changes = [modified, [], removed, [], []]
7365                 else:
7366                     changes = self.status(match=match)
7367             else:
7368                 p1, p2 = p1, p2 or nullid
7369                 update_dirstate = (self.dirstate.parents()[0] == p1)
7370                 changes = [files, [], [], [], []]
7371     
7372             ms = merge_.mergestate(self)
7373             for f in changes[0]:
7374                 if f in ms and ms[f] == 'u':
7375                     raise util.Abort(_("unresolved merge conflicts "
7376                                                     "(see hg resolve)"))
7377             wctx = context.workingctx(self, (p1, p2), text, user, date,
7378                                       extra, changes)
7379             r = self._commitctx(wctx, force, force_editor, empty_ok,
7380 >                               use_dirstate, update_dirstate)
7381 
7382 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
7383 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7384 
7385     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
7386                   use_dirstate=True, update_dirstate=True):
7387         tr = None
7388         valid = 0 # don't save the dirstate if this isn't set
7389         try:
7390             commit = util.sort(wctx.modified() + wctx.added())
7391             remove = wctx.removed()
7392             extra = wctx.extra().copy()
7393             branchname = extra['branch']
7394             user = wctx.user()
7395             text = wctx.description()
7396     
7397             p1, p2 = [p.node() for p in wctx.parents()]
7398             c1 = self.changelog.read(p1)
7399             c2 = self.changelog.read(p2)
7400             m1 = self.manifest.read(c1[0]).copy()
7401             m2 = self.manifest.read(c2[0])
7402     
7403             if use_dirstate:
7404                 oldname = c1[5].get("branch") # stored in UTF-8
7405                 if (not commit and not remove and not force and p2 == nullid
7406                     and branchname == oldname):
7407                     self.ui.status(_("nothing changed\n"))
7408                     return None
7409     
7410             xp1 = hex(p1)
7411             if p2 == nullid: xp2 = ''
7412             else: xp2 = hex(p2)
7413     
7414             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
7415     
7416             tr = self.transaction()
7417             trp = weakref.proxy(tr)
7418     
7419             # check in files
7420             new = {}
7421             changed = []
7422             linkrev = len(self)
7423             for f in commit:
7424                 self.ui.note(f + "\n")
7425                 try:
7426                     fctx = wctx.filectx(f)
7427                     newflags = fctx.flags()
7428                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
7429                     if ((not changed or changed[-1] != f) and
7430                         m2.get(f) != new[f]):
7431                         # mention the file in the changelog if some
7432                         # flag changed, even if there was no content
7433                         # change.
7434                         if m1.flags(f) != newflags:
7435                             changed.append(f)
7436                     m1.set(f, newflags)
7437                     if use_dirstate:
7438                         self.dirstate.normal(f)
7439     
7440                 except (OSError, IOError):
7441                     if use_dirstate:
7442                         self.ui.warn(_("trouble committing %s!\n") % f)
7443                         raise
7444                     else:
7445                         remove.append(f)
7446     
7447             updated, added = [], []
7448             for f in util.sort(changed):
7449                 if f in m1 or f in m2:
7450                     updated.append(f)
7451                 else:
7452                     added.append(f)
7453     
7454             # update manifest
7455             m1.update(new)
7456             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
7457             removed1 = []
7458     
7459             for f in removed:
7460                 if f in m1:
7461                     del m1[f]
7462                     removed1.append(f)
7463             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
7464                                    (new, removed1))
7465     
7466             # add changeset
7467             if (not empty_ok and not text) or force_editor:
7468                 edittext = []
7469                 if text:
7470                     edittext.append(text)
7471                 edittext.append("")
7472                 edittext.append("") # Empty line between message and comments.
7473                 edittext.append(_("HG: Enter commit message."
7474                                   "  Lines beginning with 'HG:' are removed."))
7475                 edittext.append("HG: --")
7476                 edittext.append("HG: user: %s" % user)
7477                 if p2 != nullid:
7478                     edittext.append("HG: branch merge")
7479                 if branchname:
7480                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
7481                 edittext.extend(["HG: added %s" % f for f in added])
7482                 edittext.extend(["HG: changed %s" % f for f in updated])
7483                 edittext.extend(["HG: removed %s" % f for f in removed])
7484                 if not added and not updated and not removed:
7485                     edittext.append("HG: no files changed")
7486                 edittext.append("")
7487                 # run editor in the repository root
7488 E               olddir = os.getcwd()
7489 >               OSError: [Errno 2] No such file or directory
7490 
7491 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
7492 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
7493 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
7494 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
7495 HG: --
7496 HG: user: nobody
7497 HG: branch 'default'
7498 HG: added ab56b4d92b40713acc5af89985d4b786
7499 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
7500 Vim: Beendet.
7501 ]2;Terminal - Terminal]1;Terminal - Terminal
7502 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
7503 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
7504 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
7505 
7506 transaction abort!
7507 rollback completed
7508 transaction abort!
7509 rollback completed
7510 
7511 - - - -  test_item_list_revisions_with_revdata_changes: recorded stderr - - - - 
7512 transaction abort!
7513 rollback completed
7514 
7515 ________________________________________________________________________________
7516  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_without_changes 
7517 
7518     def test_item_list_revisions_without_changes(self):
7519         item = self.backend.create_item("item_13")
7520         for revno in range(0, 10):
7521             item.create_revision(revno)
7522 >           item.commit()
7523 
7524 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:350]
7525 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7526 
7527     def commit(self):
7528         """
7529             @see: Backend._commit_item.__doc__
7530             """
7531         assert self._uncommitted_revision is not None
7532 >       self._backend._commit_item(self._uncommitted_revision)
7533 
7534 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
7535 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7536 
7537     def _commit_item(self, revision, second_parent=None):
7538         """
7539             Commit given Item Revision to repository. Update and commit Item index file.
7540             If Revision already exists, raise RevisionAlreadyExistsError.
7541             """
7542         item = revision.item
7543         lock = self._lock_repo() #XXX: lock item only!
7544         try:
7545             if not item._id:
7546                 self._add_item(item)
7547             elif revision.revno in self._list_revisions(item):
7548                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
7549     
7550             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
7551             if revision.revno > 0:
7552                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
7553                 if second_parent:
7554                     parents.append(second_parent)
7555             else:
7556                 self._open_item_index(item, 'wb').close()
7557                 self._repo.add([item._id, "%s.rev" % item._id])
7558                 parents = []
7559             internal_meta = {'rev': revision.revno,
7560                              'name': item.name,
7561                              'id': item._id,
7562                              'parents': " ".join(parents)}
7563             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
7564             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
7565     
7566             if not revision.timestamp:
7567                 revision.timestamp = long(time.time())
7568             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
7569             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
7570             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
7571             try:
7572                 match = mercurial.match.exact(self._rev_path, '', [item._id])
7573 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
7574 
7575 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
7576 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7577 
7578     def commit(self, files=None, text="", user=None, date=None,
7579                match=None, force=False, force_editor=False,
7580                p1=None, p2=None, extra={}, empty_ok=False):
7581         wlock = lock = None
7582         if extra.get("close"):
7583             force = True
7584         if files:
7585             files = util.unique(files)
7586         try:
7587             wlock = self.wlock()
7588             lock = self.lock()
7589             use_dirstate = (p1 is None) # not rawcommit
7590     
7591             if use_dirstate:
7592                 p1, p2 = self.dirstate.parents()
7593                 update_dirstate = True
7594     
7595                 if (not force and p2 != nullid and
7596                     (match and (match.files() or match.anypats()))):
7597                     raise util.Abort(_('cannot partially commit a merge '
7598                                        '(do not specify files or patterns)'))
7599     
7600                 if files:
7601                     modified, removed = [], []
7602                     for f in files:
7603                         s = self.dirstate[f]
7604                         if s in 'nma':
7605                             modified.append(f)
7606                         elif s == 'r':
7607                             removed.append(f)
7608                         else:
7609                             self.ui.warn(_("%s not tracked!\n") % f)
7610                     changes = [modified, [], removed, [], []]
7611                 else:
7612                     changes = self.status(match=match)
7613             else:
7614                 p1, p2 = p1, p2 or nullid
7615                 update_dirstate = (self.dirstate.parents()[0] == p1)
7616                 changes = [files, [], [], [], []]
7617     
7618             ms = merge_.mergestate(self)
7619             for f in changes[0]:
7620                 if f in ms and ms[f] == 'u':
7621                     raise util.Abort(_("unresolved merge conflicts "
7622                                                     "(see hg resolve)"))
7623             wctx = context.workingctx(self, (p1, p2), text, user, date,
7624                                       extra, changes)
7625             r = self._commitctx(wctx, force, force_editor, empty_ok,
7626 >                               use_dirstate, update_dirstate)
7627 
7628 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
7629 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7630 
7631     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
7632                   use_dirstate=True, update_dirstate=True):
7633         tr = None
7634         valid = 0 # don't save the dirstate if this isn't set
7635         try:
7636             commit = util.sort(wctx.modified() + wctx.added())
7637             remove = wctx.removed()
7638             extra = wctx.extra().copy()
7639             branchname = extra['branch']
7640             user = wctx.user()
7641             text = wctx.description()
7642     
7643             p1, p2 = [p.node() for p in wctx.parents()]
7644             c1 = self.changelog.read(p1)
7645             c2 = self.changelog.read(p2)
7646             m1 = self.manifest.read(c1[0]).copy()
7647             m2 = self.manifest.read(c2[0])
7648     
7649             if use_dirstate:
7650                 oldname = c1[5].get("branch") # stored in UTF-8
7651                 if (not commit and not remove and not force and p2 == nullid
7652                     and branchname == oldname):
7653                     self.ui.status(_("nothing changed\n"))
7654                     return None
7655     
7656             xp1 = hex(p1)
7657             if p2 == nullid: xp2 = ''
7658             else: xp2 = hex(p2)
7659     
7660             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
7661     
7662             tr = self.transaction()
7663             trp = weakref.proxy(tr)
7664     
7665             # check in files
7666             new = {}
7667             changed = []
7668             linkrev = len(self)
7669             for f in commit:
7670                 self.ui.note(f + "\n")
7671                 try:
7672                     fctx = wctx.filectx(f)
7673                     newflags = fctx.flags()
7674                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
7675                     if ((not changed or changed[-1] != f) and
7676                         m2.get(f) != new[f]):
7677                         # mention the file in the changelog if some
7678                         # flag changed, even if there was no content
7679                         # change.
7680                         if m1.flags(f) != newflags:
7681                             changed.append(f)
7682                     m1.set(f, newflags)
7683                     if use_dirstate:
7684                         self.dirstate.normal(f)
7685     
7686                 except (OSError, IOError):
7687                     if use_dirstate:
7688                         self.ui.warn(_("trouble committing %s!\n") % f)
7689                         raise
7690                     else:
7691                         remove.append(f)
7692     
7693             updated, added = [], []
7694             for f in util.sort(changed):
7695                 if f in m1 or f in m2:
7696                     updated.append(f)
7697                 else:
7698                     added.append(f)
7699     
7700             # update manifest
7701             m1.update(new)
7702             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
7703             removed1 = []
7704     
7705             for f in removed:
7706                 if f in m1:
7707                     del m1[f]
7708                     removed1.append(f)
7709             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
7710                                    (new, removed1))
7711     
7712             # add changeset
7713             if (not empty_ok and not text) or force_editor:
7714                 edittext = []
7715                 if text:
7716                     edittext.append(text)
7717                 edittext.append("")
7718                 edittext.append("") # Empty line between message and comments.
7719                 edittext.append(_("HG: Enter commit message."
7720                                   "  Lines beginning with 'HG:' are removed."))
7721                 edittext.append("HG: --")
7722                 edittext.append("HG: user: %s" % user)
7723                 if p2 != nullid:
7724                     edittext.append("HG: branch merge")
7725                 if branchname:
7726                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
7727                 edittext.extend(["HG: added %s" % f for f in added])
7728                 edittext.extend(["HG: changed %s" % f for f in updated])
7729                 edittext.extend(["HG: removed %s" % f for f in removed])
7730                 if not added and not updated and not removed:
7731                     edittext.append("HG: no files changed")
7732                 edittext.append("")
7733                 # run editor in the repository root
7734 E               olddir = os.getcwd()
7735 >               OSError: [Errno 2] No such file or directory
7736 
7737 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
7738 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
7739 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
7740 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
7741 HG: --
7742 HG: user: nobody
7743 HG: branch 'default'
7744 HG: added ab56b4d92b40713acc5af89985d4b786
7745 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
7746 Vim: Beendet.
7747 ]2;Terminal - Terminal]1;Terminal - Terminal
7748 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
7749 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
7750 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
7751 
7752 transaction abort!
7753 rollback completed
7754 transaction abort!
7755 rollback completed
7756 
7757 - - - - -  test_item_list_revisions_without_changes: recorded stderr - - - - - -
7758 transaction abort!
7759 rollback completed
7760 
7761 ________________________________________________________________________________
7762  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_list_revisions_equality_nonempty_revlist 
7763 
7764     def test_item_list_revisions_equality_nonempty_revlist(self):
7765         item = self.backend.create_item("new_item_16")
7766         rev = item.create_revision(0)
7767         rev.write("something interesting")
7768 >       item.commit()
7769 
7770 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:364]
7771 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7772 
7773     def commit(self):
7774         """
7775             @see: Backend._commit_item.__doc__
7776             """
7777         assert self._uncommitted_revision is not None
7778 >       self._backend._commit_item(self._uncommitted_revision)
7779 
7780 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
7781 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7782 
7783     def _commit_item(self, revision, second_parent=None):
7784         """
7785             Commit given Item Revision to repository. Update and commit Item index file.
7786             If Revision already exists, raise RevisionAlreadyExistsError.
7787             """
7788         item = revision.item
7789         lock = self._lock_repo() #XXX: lock item only!
7790         try:
7791             if not item._id:
7792                 self._add_item(item)
7793             elif revision.revno in self._list_revisions(item):
7794                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
7795     
7796             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
7797             if revision.revno > 0:
7798                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
7799                 if second_parent:
7800                     parents.append(second_parent)
7801             else:
7802                 self._open_item_index(item, 'wb').close()
7803                 self._repo.add([item._id, "%s.rev" % item._id])
7804                 parents = []
7805             internal_meta = {'rev': revision.revno,
7806                              'name': item.name,
7807                              'id': item._id,
7808                              'parents': " ".join(parents)}
7809             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
7810             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
7811     
7812             if not revision.timestamp:
7813                 revision.timestamp = long(time.time())
7814             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
7815             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
7816             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
7817             try:
7818                 match = mercurial.match.exact(self._rev_path, '', [item._id])
7819 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
7820 
7821 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
7822 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7823 
7824     def commit(self, files=None, text="", user=None, date=None,
7825                match=None, force=False, force_editor=False,
7826                p1=None, p2=None, extra={}, empty_ok=False):
7827         wlock = lock = None
7828         if extra.get("close"):
7829             force = True
7830         if files:
7831             files = util.unique(files)
7832         try:
7833             wlock = self.wlock()
7834             lock = self.lock()
7835             use_dirstate = (p1 is None) # not rawcommit
7836     
7837             if use_dirstate:
7838                 p1, p2 = self.dirstate.parents()
7839                 update_dirstate = True
7840     
7841                 if (not force and p2 != nullid and
7842                     (match and (match.files() or match.anypats()))):
7843                     raise util.Abort(_('cannot partially commit a merge '
7844                                        '(do not specify files or patterns)'))
7845     
7846                 if files:
7847                     modified, removed = [], []
7848                     for f in files:
7849                         s = self.dirstate[f]
7850                         if s in 'nma':
7851                             modified.append(f)
7852                         elif s == 'r':
7853                             removed.append(f)
7854                         else:
7855                             self.ui.warn(_("%s not tracked!\n") % f)
7856                     changes = [modified, [], removed, [], []]
7857                 else:
7858                     changes = self.status(match=match)
7859             else:
7860                 p1, p2 = p1, p2 or nullid
7861                 update_dirstate = (self.dirstate.parents()[0] == p1)
7862                 changes = [files, [], [], [], []]
7863     
7864             ms = merge_.mergestate(self)
7865             for f in changes[0]:
7866                 if f in ms and ms[f] == 'u':
7867                     raise util.Abort(_("unresolved merge conflicts "
7868                                                     "(see hg resolve)"))
7869             wctx = context.workingctx(self, (p1, p2), text, user, date,
7870                                       extra, changes)
7871             r = self._commitctx(wctx, force, force_editor, empty_ok,
7872 >                               use_dirstate, update_dirstate)
7873 
7874 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
7875 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
7876 
7877     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
7878                   use_dirstate=True, update_dirstate=True):
7879         tr = None
7880         valid = 0 # don't save the dirstate if this isn't set
7881         try:
7882             commit = util.sort(wctx.modified() + wctx.added())
7883             remove = wctx.removed()
7884             extra = wctx.extra().copy()
7885             branchname = extra['branch']
7886             user = wctx.user()
7887             text = wctx.description()
7888     
7889             p1, p2 = [p.node() for p in wctx.parents()]
7890             c1 = self.changelog.read(p1)
7891             c2 = self.changelog.read(p2)
7892             m1 = self.manifest.read(c1[0]).copy()
7893             m2 = self.manifest.read(c2[0])
7894     
7895             if use_dirstate:
7896                 oldname = c1[5].get("branch") # stored in UTF-8
7897                 if (not commit and not remove and not force and p2 == nullid
7898                     and branchname == oldname):
7899                     self.ui.status(_("nothing changed\n"))
7900                     return None
7901     
7902             xp1 = hex(p1)
7903             if p2 == nullid: xp2 = ''
7904             else: xp2 = hex(p2)
7905     
7906             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
7907     
7908             tr = self.transaction()
7909             trp = weakref.proxy(tr)
7910     
7911             # check in files
7912             new = {}
7913             changed = []
7914             linkrev = len(self)
7915             for f in commit:
7916                 self.ui.note(f + "\n")
7917                 try:
7918                     fctx = wctx.filectx(f)
7919                     newflags = fctx.flags()
7920                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
7921                     if ((not changed or changed[-1] != f) and
7922                         m2.get(f) != new[f]):
7923                         # mention the file in the changelog if some
7924                         # flag changed, even if there was no content
7925                         # change.
7926                         if m1.flags(f) != newflags:
7927                             changed.append(f)
7928                     m1.set(f, newflags)
7929                     if use_dirstate:
7930                         self.dirstate.normal(f)
7931     
7932                 except (OSError, IOError):
7933                     if use_dirstate:
7934                         self.ui.warn(_("trouble committing %s!\n") % f)
7935                         raise
7936                     else:
7937                         remove.append(f)
7938     
7939             updated, added = [], []
7940             for f in util.sort(changed):
7941                 if f in m1 or f in m2:
7942                     updated.append(f)
7943                 else:
7944                     added.append(f)
7945     
7946             # update manifest
7947             m1.update(new)
7948             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
7949             removed1 = []
7950     
7951             for f in removed:
7952                 if f in m1:
7953                     del m1[f]
7954                     removed1.append(f)
7955             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
7956                                    (new, removed1))
7957     
7958             # add changeset
7959             if (not empty_ok and not text) or force_editor:
7960                 edittext = []
7961                 if text:
7962                     edittext.append(text)
7963                 edittext.append("")
7964                 edittext.append("") # Empty line between message and comments.
7965                 edittext.append(_("HG: Enter commit message."
7966                                   "  Lines beginning with 'HG:' are removed."))
7967                 edittext.append("HG: --")
7968                 edittext.append("HG: user: %s" % user)
7969                 if p2 != nullid:
7970                     edittext.append("HG: branch merge")
7971                 if branchname:
7972                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
7973                 edittext.extend(["HG: added %s" % f for f in added])
7974                 edittext.extend(["HG: changed %s" % f for f in updated])
7975                 edittext.extend(["HG: removed %s" % f for f in removed])
7976                 if not added and not updated and not removed:
7977                     edittext.append("HG: no files changed")
7978                 edittext.append("")
7979                 # run editor in the repository root
7980 E               olddir = os.getcwd()
7981 >               OSError: [Errno 2] No such file or directory
7982 
7983 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
7984 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
7985 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
7986 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
7987 HG: --
7988 HG: user: nobody
7989 HG: branch 'default'
7990 HG: added ab56b4d92b40713acc5af89985d4b786
7991 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
7992 Vim: Beendet.
7993 ]2;Terminal - Terminal]1;Terminal - Terminal
7994 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
7995 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
7996 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
7997 
7998 transaction abort!
7999 rollback completed
8000 transaction abort!
8001 rollback completed
8002 
8003 - -  test_item_list_revisions_equality_nonempty_revlist: recorded stderr - - -
8004 transaction abort!
8005 rollback completed
8006 
8007 ________________________________________________________________________________
8008  entrypoint: test_backends_hg.py TestMercurialBackend().test_item_create_existing_mixed_2 
8009 
8010     def test_item_create_existing_mixed_2(self):
8011         item1 = self.backend.create_item('existing now 0')
8012         item1.change_metadata()
8013         item2 = self.backend.create_item('existing now 0')
8014         item2.create_revision(0)
8015 >       item2.commit()
8016 
8017 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:420]
8018 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8019 
8020     def commit(self):
8021         """
8022             @see: Backend._commit_item.__doc__
8023             """
8024         assert self._uncommitted_revision is not None
8025 >       self._backend._commit_item(self._uncommitted_revision)
8026 
8027 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
8028 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8029 
8030     def _commit_item(self, revision, second_parent=None):
8031         """
8032             Commit given Item Revision to repository. Update and commit Item index file.
8033             If Revision already exists, raise RevisionAlreadyExistsError.
8034             """
8035         item = revision.item
8036         lock = self._lock_repo() #XXX: lock item only!
8037         try:
8038             if not item._id:
8039                 self._add_item(item)
8040             elif revision.revno in self._list_revisions(item):
8041                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
8042     
8043             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
8044             if revision.revno > 0:
8045                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
8046                 if second_parent:
8047                     parents.append(second_parent)
8048             else:
8049                 self._open_item_index(item, 'wb').close()
8050                 self._repo.add([item._id, "%s.rev" % item._id])
8051                 parents = []
8052             internal_meta = {'rev': revision.revno,
8053                              'name': item.name,
8054                              'id': item._id,
8055                              'parents': " ".join(parents)}
8056             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
8057             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
8058     
8059             if not revision.timestamp:
8060                 revision.timestamp = long(time.time())
8061             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
8062             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
8063             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
8064             try:
8065                 match = mercurial.match.exact(self._rev_path, '', [item._id])
8066 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
8067 
8068 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
8069 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8070 
8071     def commit(self, files=None, text="", user=None, date=None,
8072                match=None, force=False, force_editor=False,
8073                p1=None, p2=None, extra={}, empty_ok=False):
8074         wlock = lock = None
8075         if extra.get("close"):
8076             force = True
8077         if files:
8078             files = util.unique(files)
8079         try:
8080             wlock = self.wlock()
8081             lock = self.lock()
8082             use_dirstate = (p1 is None) # not rawcommit
8083     
8084             if use_dirstate:
8085                 p1, p2 = self.dirstate.parents()
8086                 update_dirstate = True
8087     
8088                 if (not force and p2 != nullid and
8089                     (match and (match.files() or match.anypats()))):
8090                     raise util.Abort(_('cannot partially commit a merge '
8091                                        '(do not specify files or patterns)'))
8092     
8093                 if files:
8094                     modified, removed = [], []
8095                     for f in files:
8096                         s = self.dirstate[f]
8097                         if s in 'nma':
8098                             modified.append(f)
8099                         elif s == 'r':
8100                             removed.append(f)
8101                         else:
8102                             self.ui.warn(_("%s not tracked!\n") % f)
8103                     changes = [modified, [], removed, [], []]
8104                 else:
8105                     changes = self.status(match=match)
8106             else:
8107                 p1, p2 = p1, p2 or nullid
8108                 update_dirstate = (self.dirstate.parents()[0] == p1)
8109                 changes = [files, [], [], [], []]
8110     
8111             ms = merge_.mergestate(self)
8112             for f in changes[0]:
8113                 if f in ms and ms[f] == 'u':
8114                     raise util.Abort(_("unresolved merge conflicts "
8115                                                     "(see hg resolve)"))
8116             wctx = context.workingctx(self, (p1, p2), text, user, date,
8117                                       extra, changes)
8118             r = self._commitctx(wctx, force, force_editor, empty_ok,
8119 >                               use_dirstate, update_dirstate)
8120 
8121 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
8122 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8123 
8124     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
8125                   use_dirstate=True, update_dirstate=True):
8126         tr = None
8127         valid = 0 # don't save the dirstate if this isn't set
8128         try:
8129             commit = util.sort(wctx.modified() + wctx.added())
8130             remove = wctx.removed()
8131             extra = wctx.extra().copy()
8132             branchname = extra['branch']
8133             user = wctx.user()
8134             text = wctx.description()
8135     
8136             p1, p2 = [p.node() for p in wctx.parents()]
8137             c1 = self.changelog.read(p1)
8138             c2 = self.changelog.read(p2)
8139             m1 = self.manifest.read(c1[0]).copy()
8140             m2 = self.manifest.read(c2[0])
8141     
8142             if use_dirstate:
8143                 oldname = c1[5].get("branch") # stored in UTF-8
8144                 if (not commit and not remove and not force and p2 == nullid
8145                     and branchname == oldname):
8146                     self.ui.status(_("nothing changed\n"))
8147                     return None
8148     
8149             xp1 = hex(p1)
8150             if p2 == nullid: xp2 = ''
8151             else: xp2 = hex(p2)
8152     
8153             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
8154     
8155             tr = self.transaction()
8156             trp = weakref.proxy(tr)
8157     
8158             # check in files
8159             new = {}
8160             changed = []
8161             linkrev = len(self)
8162             for f in commit:
8163                 self.ui.note(f + "\n")
8164                 try:
8165                     fctx = wctx.filectx(f)
8166                     newflags = fctx.flags()
8167                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
8168                     if ((not changed or changed[-1] != f) and
8169                         m2.get(f) != new[f]):
8170                         # mention the file in the changelog if some
8171                         # flag changed, even if there was no content
8172                         # change.
8173                         if m1.flags(f) != newflags:
8174                             changed.append(f)
8175                     m1.set(f, newflags)
8176                     if use_dirstate:
8177                         self.dirstate.normal(f)
8178     
8179                 except (OSError, IOError):
8180                     if use_dirstate:
8181                         self.ui.warn(_("trouble committing %s!\n") % f)
8182                         raise
8183                     else:
8184                         remove.append(f)
8185     
8186             updated, added = [], []
8187             for f in util.sort(changed):
8188                 if f in m1 or f in m2:
8189                     updated.append(f)
8190                 else:
8191                     added.append(f)
8192     
8193             # update manifest
8194             m1.update(new)
8195             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
8196             removed1 = []
8197     
8198             for f in removed:
8199                 if f in m1:
8200                     del m1[f]
8201                     removed1.append(f)
8202             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
8203                                    (new, removed1))
8204     
8205             # add changeset
8206             if (not empty_ok and not text) or force_editor:
8207                 edittext = []
8208                 if text:
8209                     edittext.append(text)
8210                 edittext.append("")
8211                 edittext.append("") # Empty line between message and comments.
8212                 edittext.append(_("HG: Enter commit message."
8213                                   "  Lines beginning with 'HG:' are removed."))
8214                 edittext.append("HG: --")
8215                 edittext.append("HG: user: %s" % user)
8216                 if p2 != nullid:
8217                     edittext.append("HG: branch merge")
8218                 if branchname:
8219                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
8220                 edittext.extend(["HG: added %s" % f for f in added])
8221                 edittext.extend(["HG: changed %s" % f for f in updated])
8222                 edittext.extend(["HG: removed %s" % f for f in removed])
8223                 if not added and not updated and not removed:
8224                     edittext.append("HG: no files changed")
8225                 edittext.append("")
8226                 # run editor in the repository root
8227 E               olddir = os.getcwd()
8228 >               OSError: [Errno 2] No such file or directory
8229 
8230 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
8231 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
8232 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
8233 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
8234 HG: --
8235 HG: user: nobody
8236 HG: branch 'default'
8237 HG: added ab56b4d92b40713acc5af89985d4b786
8238 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
8239 Vim: Beendet.
8240 ]2;Terminal - Terminal]1;Terminal - Terminal
8241 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
8242 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
8243 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
8244 
8245 transaction abort!
8246 rollback completed
8247 transaction abort!
8248 rollback completed
8249 
8250 - - - - - - -  test_item_create_existing_mixed_2: recorded stderr - - - - - - - 
8251 transaction abort!
8252 rollback completed
8253 
8254 ________________________________________________________________________________
8255 _____ entrypoint: test_backends_hg.py TestMercurialBackend().test_metadata _____
8256 
8257     def test_metadata(self):
8258 >       self.create_rev_item_helper('no metadata')
8259 
8260 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:446]
8261 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8262 
8263     def create_rev_item_helper(self, name):
8264         item = self.backend.create_item(name)
8265         item.create_revision(0)
8266 >       item.commit()
8267 
8268 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
8269 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8270 
8271     def commit(self):
8272         """
8273             @see: Backend._commit_item.__doc__
8274             """
8275         assert self._uncommitted_revision is not None
8276 >       self._backend._commit_item(self._uncommitted_revision)
8277 
8278 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
8279 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8280 
8281     def _commit_item(self, revision, second_parent=None):
8282         """
8283             Commit given Item Revision to repository. Update and commit Item index file.
8284             If Revision already exists, raise RevisionAlreadyExistsError.
8285             """
8286         item = revision.item
8287         lock = self._lock_repo() #XXX: lock item only!
8288         try:
8289             if not item._id:
8290                 self._add_item(item)
8291             elif revision.revno in self._list_revisions(item):
8292                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
8293     
8294             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
8295             if revision.revno > 0:
8296                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
8297                 if second_parent:
8298                     parents.append(second_parent)
8299             else:
8300                 self._open_item_index(item, 'wb').close()
8301                 self._repo.add([item._id, "%s.rev" % item._id])
8302                 parents = []
8303             internal_meta = {'rev': revision.revno,
8304                              'name': item.name,
8305                              'id': item._id,
8306                              'parents': " ".join(parents)}
8307             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
8308             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
8309     
8310             if not revision.timestamp:
8311                 revision.timestamp = long(time.time())
8312             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
8313             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
8314             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
8315             try:
8316                 match = mercurial.match.exact(self._rev_path, '', [item._id])
8317 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
8318 
8319 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
8320 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8321 
8322     def commit(self, files=None, text="", user=None, date=None,
8323                match=None, force=False, force_editor=False,
8324                p1=None, p2=None, extra={}, empty_ok=False):
8325         wlock = lock = None
8326         if extra.get("close"):
8327             force = True
8328         if files:
8329             files = util.unique(files)
8330         try:
8331             wlock = self.wlock()
8332             lock = self.lock()
8333             use_dirstate = (p1 is None) # not rawcommit
8334     
8335             if use_dirstate:
8336                 p1, p2 = self.dirstate.parents()
8337                 update_dirstate = True
8338     
8339                 if (not force and p2 != nullid and
8340                     (match and (match.files() or match.anypats()))):
8341                     raise util.Abort(_('cannot partially commit a merge '
8342                                        '(do not specify files or patterns)'))
8343     
8344                 if files:
8345                     modified, removed = [], []
8346                     for f in files:
8347                         s = self.dirstate[f]
8348                         if s in 'nma':
8349                             modified.append(f)
8350                         elif s == 'r':
8351                             removed.append(f)
8352                         else:
8353                             self.ui.warn(_("%s not tracked!\n") % f)
8354                     changes = [modified, [], removed, [], []]
8355                 else:
8356                     changes = self.status(match=match)
8357             else:
8358                 p1, p2 = p1, p2 or nullid
8359                 update_dirstate = (self.dirstate.parents()[0] == p1)
8360                 changes = [files, [], [], [], []]
8361     
8362             ms = merge_.mergestate(self)
8363             for f in changes[0]:
8364                 if f in ms and ms[f] == 'u':
8365                     raise util.Abort(_("unresolved merge conflicts "
8366                                                     "(see hg resolve)"))
8367             wctx = context.workingctx(self, (p1, p2), text, user, date,
8368                                       extra, changes)
8369             r = self._commitctx(wctx, force, force_editor, empty_ok,
8370 >                               use_dirstate, update_dirstate)
8371 
8372 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
8373 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8374 
8375     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
8376                   use_dirstate=True, update_dirstate=True):
8377         tr = None
8378         valid = 0 # don't save the dirstate if this isn't set
8379         try:
8380             commit = util.sort(wctx.modified() + wctx.added())
8381             remove = wctx.removed()
8382             extra = wctx.extra().copy()
8383             branchname = extra['branch']
8384             user = wctx.user()
8385             text = wctx.description()
8386     
8387             p1, p2 = [p.node() for p in wctx.parents()]
8388             c1 = self.changelog.read(p1)
8389             c2 = self.changelog.read(p2)
8390             m1 = self.manifest.read(c1[0]).copy()
8391             m2 = self.manifest.read(c2[0])
8392     
8393             if use_dirstate:
8394                 oldname = c1[5].get("branch") # stored in UTF-8
8395                 if (not commit and not remove and not force and p2 == nullid
8396                     and branchname == oldname):
8397                     self.ui.status(_("nothing changed\n"))
8398                     return None
8399     
8400             xp1 = hex(p1)
8401             if p2 == nullid: xp2 = ''
8402             else: xp2 = hex(p2)
8403     
8404             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
8405     
8406             tr = self.transaction()
8407             trp = weakref.proxy(tr)
8408     
8409             # check in files
8410             new = {}
8411             changed = []
8412             linkrev = len(self)
8413             for f in commit:
8414                 self.ui.note(f + "\n")
8415                 try:
8416                     fctx = wctx.filectx(f)
8417                     newflags = fctx.flags()
8418                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
8419                     if ((not changed or changed[-1] != f) and
8420                         m2.get(f) != new[f]):
8421                         # mention the file in the changelog if some
8422                         # flag changed, even if there was no content
8423                         # change.
8424                         if m1.flags(f) != newflags:
8425                             changed.append(f)
8426                     m1.set(f, newflags)
8427                     if use_dirstate:
8428                         self.dirstate.normal(f)
8429     
8430                 except (OSError, IOError):
8431                     if use_dirstate:
8432                         self.ui.warn(_("trouble committing %s!\n") % f)
8433                         raise
8434                     else:
8435                         remove.append(f)
8436     
8437             updated, added = [], []
8438             for f in util.sort(changed):
8439                 if f in m1 or f in m2:
8440                     updated.append(f)
8441                 else:
8442                     added.append(f)
8443     
8444             # update manifest
8445             m1.update(new)
8446             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
8447             removed1 = []
8448     
8449             for f in removed:
8450                 if f in m1:
8451                     del m1[f]
8452                     removed1.append(f)
8453             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
8454                                    (new, removed1))
8455     
8456             # add changeset
8457             if (not empty_ok and not text) or force_editor:
8458                 edittext = []
8459                 if text:
8460                     edittext.append(text)
8461                 edittext.append("")
8462                 edittext.append("") # Empty line between message and comments.
8463                 edittext.append(_("HG: Enter commit message."
8464                                   "  Lines beginning with 'HG:' are removed."))
8465                 edittext.append("HG: --")
8466                 edittext.append("HG: user: %s" % user)
8467                 if p2 != nullid:
8468                     edittext.append("HG: branch merge")
8469                 if branchname:
8470                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
8471                 edittext.extend(["HG: added %s" % f for f in added])
8472                 edittext.extend(["HG: changed %s" % f for f in updated])
8473                 edittext.extend(["HG: removed %s" % f for f in removed])
8474                 if not added and not updated and not removed:
8475                     edittext.append("HG: no files changed")
8476                 edittext.append("")
8477                 # run editor in the repository root
8478 E               olddir = os.getcwd()
8479 >               OSError: [Errno 2] No such file or directory
8480 
8481 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
8482 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
8483 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
8484 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
8485 HG: --
8486 HG: user: nobody
8487 HG: branch 'default'
8488 HG: added ab56b4d92b40713acc5af89985d4b786
8489 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
8490 Vim: Beendet.
8491 ]2;Terminal - Terminal]1;Terminal - Terminal
8492 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
8493 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
8494 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
8495 
8496 transaction abort!
8497 rollback completed
8498 transaction abort!
8499 rollback completed
8500 
8501 - - - - - - - - - - - -  test_metadata: recorded stderr - - - - - - - - - - - - 
8502 transaction abort!
8503 rollback completed
8504 
8505 ________________________________________________________________________________
8506  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_revision_change_meta 
8507 
8508     def test_create_revision_change_meta(self):
8509         item = self.backend.create_item("double")
8510         rev = item.create_revision(0)
8511         rev["revno"] = "0"
8512 >       item.commit()
8513 
8514 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:459]
8515 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8516 
8517     def commit(self):
8518         """
8519             @see: Backend._commit_item.__doc__
8520             """
8521         assert self._uncommitted_revision is not None
8522 >       self._backend._commit_item(self._uncommitted_revision)
8523 
8524 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
8525 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8526 
8527     def _commit_item(self, revision, second_parent=None):
8528         """
8529             Commit given Item Revision to repository. Update and commit Item index file.
8530             If Revision already exists, raise RevisionAlreadyExistsError.
8531             """
8532         item = revision.item
8533         lock = self._lock_repo() #XXX: lock item only!
8534         try:
8535             if not item._id:
8536                 self._add_item(item)
8537             elif revision.revno in self._list_revisions(item):
8538                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
8539     
8540             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
8541             if revision.revno > 0:
8542                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
8543                 if second_parent:
8544                     parents.append(second_parent)
8545             else:
8546                 self._open_item_index(item, 'wb').close()
8547                 self._repo.add([item._id, "%s.rev" % item._id])
8548                 parents = []
8549             internal_meta = {'rev': revision.revno,
8550                              'name': item.name,
8551                              'id': item._id,
8552                              'parents': " ".join(parents)}
8553             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
8554             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
8555     
8556             if not revision.timestamp:
8557                 revision.timestamp = long(time.time())
8558             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
8559             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
8560             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
8561             try:
8562                 match = mercurial.match.exact(self._rev_path, '', [item._id])
8563 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
8564 
8565 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
8566 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8567 
8568     def commit(self, files=None, text="", user=None, date=None,
8569                match=None, force=False, force_editor=False,
8570                p1=None, p2=None, extra={}, empty_ok=False):
8571         wlock = lock = None
8572         if extra.get("close"):
8573             force = True
8574         if files:
8575             files = util.unique(files)
8576         try:
8577             wlock = self.wlock()
8578             lock = self.lock()
8579             use_dirstate = (p1 is None) # not rawcommit
8580     
8581             if use_dirstate:
8582                 p1, p2 = self.dirstate.parents()
8583                 update_dirstate = True
8584     
8585                 if (not force and p2 != nullid and
8586                     (match and (match.files() or match.anypats()))):
8587                     raise util.Abort(_('cannot partially commit a merge '
8588                                        '(do not specify files or patterns)'))
8589     
8590                 if files:
8591                     modified, removed = [], []
8592                     for f in files:
8593                         s = self.dirstate[f]
8594                         if s in 'nma':
8595                             modified.append(f)
8596                         elif s == 'r':
8597                             removed.append(f)
8598                         else:
8599                             self.ui.warn(_("%s not tracked!\n") % f)
8600                     changes = [modified, [], removed, [], []]
8601                 else:
8602                     changes = self.status(match=match)
8603             else:
8604                 p1, p2 = p1, p2 or nullid
8605                 update_dirstate = (self.dirstate.parents()[0] == p1)
8606                 changes = [files, [], [], [], []]
8607     
8608             ms = merge_.mergestate(self)
8609             for f in changes[0]:
8610                 if f in ms and ms[f] == 'u':
8611                     raise util.Abort(_("unresolved merge conflicts "
8612                                                     "(see hg resolve)"))
8613             wctx = context.workingctx(self, (p1, p2), text, user, date,
8614                                       extra, changes)
8615             r = self._commitctx(wctx, force, force_editor, empty_ok,
8616 >                               use_dirstate, update_dirstate)
8617 
8618 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
8619 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8620 
8621     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
8622                   use_dirstate=True, update_dirstate=True):
8623         tr = None
8624         valid = 0 # don't save the dirstate if this isn't set
8625         try:
8626             commit = util.sort(wctx.modified() + wctx.added())
8627             remove = wctx.removed()
8628             extra = wctx.extra().copy()
8629             branchname = extra['branch']
8630             user = wctx.user()
8631             text = wctx.description()
8632     
8633             p1, p2 = [p.node() for p in wctx.parents()]
8634             c1 = self.changelog.read(p1)
8635             c2 = self.changelog.read(p2)
8636             m1 = self.manifest.read(c1[0]).copy()
8637             m2 = self.manifest.read(c2[0])
8638     
8639             if use_dirstate:
8640                 oldname = c1[5].get("branch") # stored in UTF-8
8641                 if (not commit and not remove and not force and p2 == nullid
8642                     and branchname == oldname):
8643                     self.ui.status(_("nothing changed\n"))
8644                     return None
8645     
8646             xp1 = hex(p1)
8647             if p2 == nullid: xp2 = ''
8648             else: xp2 = hex(p2)
8649     
8650             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
8651     
8652             tr = self.transaction()
8653             trp = weakref.proxy(tr)
8654     
8655             # check in files
8656             new = {}
8657             changed = []
8658             linkrev = len(self)
8659             for f in commit:
8660                 self.ui.note(f + "\n")
8661                 try:
8662                     fctx = wctx.filectx(f)
8663                     newflags = fctx.flags()
8664                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
8665                     if ((not changed or changed[-1] != f) and
8666                         m2.get(f) != new[f]):
8667                         # mention the file in the changelog if some
8668                         # flag changed, even if there was no content
8669                         # change.
8670                         if m1.flags(f) != newflags:
8671                             changed.append(f)
8672                     m1.set(f, newflags)
8673                     if use_dirstate:
8674                         self.dirstate.normal(f)
8675     
8676                 except (OSError, IOError):
8677                     if use_dirstate:
8678                         self.ui.warn(_("trouble committing %s!\n") % f)
8679                         raise
8680                     else:
8681                         remove.append(f)
8682     
8683             updated, added = [], []
8684             for f in util.sort(changed):
8685                 if f in m1 or f in m2:
8686                     updated.append(f)
8687                 else:
8688                     added.append(f)
8689     
8690             # update manifest
8691             m1.update(new)
8692             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
8693             removed1 = []
8694     
8695             for f in removed:
8696                 if f in m1:
8697                     del m1[f]
8698                     removed1.append(f)
8699             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
8700                                    (new, removed1))
8701     
8702             # add changeset
8703             if (not empty_ok and not text) or force_editor:
8704                 edittext = []
8705                 if text:
8706                     edittext.append(text)
8707                 edittext.append("")
8708                 edittext.append("") # Empty line between message and comments.
8709                 edittext.append(_("HG: Enter commit message."
8710                                   "  Lines beginning with 'HG:' are removed."))
8711                 edittext.append("HG: --")
8712                 edittext.append("HG: user: %s" % user)
8713                 if p2 != nullid:
8714                     edittext.append("HG: branch merge")
8715                 if branchname:
8716                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
8717                 edittext.extend(["HG: added %s" % f for f in added])
8718                 edittext.extend(["HG: changed %s" % f for f in updated])
8719                 edittext.extend(["HG: removed %s" % f for f in removed])
8720                 if not added and not updated and not removed:
8721                     edittext.append("HG: no files changed")
8722                 edittext.append("")
8723                 # run editor in the repository root
8724 E               olddir = os.getcwd()
8725 >               OSError: [Errno 2] No such file or directory
8726 
8727 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
8728 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
8729 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
8730 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
8731 HG: --
8732 HG: user: nobody
8733 HG: branch 'default'
8734 HG: added ab56b4d92b40713acc5af89985d4b786
8735 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
8736 Vim: Beendet.
8737 ]2;Terminal - Terminal]1;Terminal - Terminal
8738 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
8739 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
8740 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
8741 
8742 transaction abort!
8743 rollback completed
8744 transaction abort!
8745 rollback completed
8746 
8747 - - - - - - -  test_create_revision_change_meta: recorded stderr - - - - - - - -
8748 transaction abort!
8749 rollback completed
8750 
8751 ________________________________________________________________________________
8752  entrypoint: test_backends_hg.py TestMercurialBackend().test_create_revision_change_empty_meta 
8753 
8754     def test_create_revision_change_empty_meta(self):
8755         item = self.backend.create_item("double")
8756         rev = item.create_revision(0)
8757         rev["revno"] = "0"
8758 >       item.commit()
8759 
8760 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:472]
8761 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8762 
8763     def commit(self):
8764         """
8765             @see: Backend._commit_item.__doc__
8766             """
8767         assert self._uncommitted_revision is not None
8768 >       self._backend._commit_item(self._uncommitted_revision)
8769 
8770 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
8771 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8772 
8773     def _commit_item(self, revision, second_parent=None):
8774         """
8775             Commit given Item Revision to repository. Update and commit Item index file.
8776             If Revision already exists, raise RevisionAlreadyExistsError.
8777             """
8778         item = revision.item
8779         lock = self._lock_repo() #XXX: lock item only!
8780         try:
8781             if not item._id:
8782                 self._add_item(item)
8783             elif revision.revno in self._list_revisions(item):
8784                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
8785     
8786             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
8787             if revision.revno > 0:
8788                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
8789                 if second_parent:
8790                     parents.append(second_parent)
8791             else:
8792                 self._open_item_index(item, 'wb').close()
8793                 self._repo.add([item._id, "%s.rev" % item._id])
8794                 parents = []
8795             internal_meta = {'rev': revision.revno,
8796                              'name': item.name,
8797                              'id': item._id,
8798                              'parents': " ".join(parents)}
8799             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
8800             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
8801     
8802             if not revision.timestamp:
8803                 revision.timestamp = long(time.time())
8804             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
8805             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
8806             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
8807             try:
8808                 match = mercurial.match.exact(self._rev_path, '', [item._id])
8809 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
8810 
8811 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
8812 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8813 
8814     def commit(self, files=None, text="", user=None, date=None,
8815                match=None, force=False, force_editor=False,
8816                p1=None, p2=None, extra={}, empty_ok=False):
8817         wlock = lock = None
8818         if extra.get("close"):
8819             force = True
8820         if files:
8821             files = util.unique(files)
8822         try:
8823             wlock = self.wlock()
8824             lock = self.lock()
8825             use_dirstate = (p1 is None) # not rawcommit
8826     
8827             if use_dirstate:
8828                 p1, p2 = self.dirstate.parents()
8829                 update_dirstate = True
8830     
8831                 if (not force and p2 != nullid and
8832                     (match and (match.files() or match.anypats()))):
8833                     raise util.Abort(_('cannot partially commit a merge '
8834                                        '(do not specify files or patterns)'))
8835     
8836                 if files:
8837                     modified, removed = [], []
8838                     for f in files:
8839                         s = self.dirstate[f]
8840                         if s in 'nma':
8841                             modified.append(f)
8842                         elif s == 'r':
8843                             removed.append(f)
8844                         else:
8845                             self.ui.warn(_("%s not tracked!\n") % f)
8846                     changes = [modified, [], removed, [], []]
8847                 else:
8848                     changes = self.status(match=match)
8849             else:
8850                 p1, p2 = p1, p2 or nullid
8851                 update_dirstate = (self.dirstate.parents()[0] == p1)
8852                 changes = [files, [], [], [], []]
8853     
8854             ms = merge_.mergestate(self)
8855             for f in changes[0]:
8856                 if f in ms and ms[f] == 'u':
8857                     raise util.Abort(_("unresolved merge conflicts "
8858                                                     "(see hg resolve)"))
8859             wctx = context.workingctx(self, (p1, p2), text, user, date,
8860                                       extra, changes)
8861             r = self._commitctx(wctx, force, force_editor, empty_ok,
8862 >                               use_dirstate, update_dirstate)
8863 
8864 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
8865 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
8866 
8867     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
8868                   use_dirstate=True, update_dirstate=True):
8869         tr = None
8870         valid = 0 # don't save the dirstate if this isn't set
8871         try:
8872             commit = util.sort(wctx.modified() + wctx.added())
8873             remove = wctx.removed()
8874             extra = wctx.extra().copy()
8875             branchname = extra['branch']
8876             user = wctx.user()
8877             text = wctx.description()
8878     
8879             p1, p2 = [p.node() for p in wctx.parents()]
8880             c1 = self.changelog.read(p1)
8881             c2 = self.changelog.read(p2)
8882             m1 = self.manifest.read(c1[0]).copy()
8883             m2 = self.manifest.read(c2[0])
8884     
8885             if use_dirstate:
8886                 oldname = c1[5].get("branch") # stored in UTF-8
8887                 if (not commit and not remove and not force and p2 == nullid
8888                     and branchname == oldname):
8889                     self.ui.status(_("nothing changed\n"))
8890                     return None
8891     
8892             xp1 = hex(p1)
8893             if p2 == nullid: xp2 = ''
8894             else: xp2 = hex(p2)
8895     
8896             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
8897     
8898             tr = self.transaction()
8899             trp = weakref.proxy(tr)
8900     
8901             # check in files
8902             new = {}
8903             changed = []
8904             linkrev = len(self)
8905             for f in commit:
8906                 self.ui.note(f + "\n")
8907                 try:
8908                     fctx = wctx.filectx(f)
8909                     newflags = fctx.flags()
8910                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
8911                     if ((not changed or changed[-1] != f) and
8912                         m2.get(f) != new[f]):
8913                         # mention the file in the changelog if some
8914                         # flag changed, even if there was no content
8915                         # change.
8916                         if m1.flags(f) != newflags:
8917                             changed.append(f)
8918                     m1.set(f, newflags)
8919                     if use_dirstate:
8920                         self.dirstate.normal(f)
8921     
8922                 except (OSError, IOError):
8923                     if use_dirstate:
8924                         self.ui.warn(_("trouble committing %s!\n") % f)
8925                         raise
8926                     else:
8927                         remove.append(f)
8928     
8929             updated, added = [], []
8930             for f in util.sort(changed):
8931                 if f in m1 or f in m2:
8932                     updated.append(f)
8933                 else:
8934                     added.append(f)
8935     
8936             # update manifest
8937             m1.update(new)
8938             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
8939             removed1 = []
8940     
8941             for f in removed:
8942                 if f in m1:
8943                     del m1[f]
8944                     removed1.append(f)
8945             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
8946                                    (new, removed1))
8947     
8948             # add changeset
8949             if (not empty_ok and not text) or force_editor:
8950                 edittext = []
8951                 if text:
8952                     edittext.append(text)
8953                 edittext.append("")
8954                 edittext.append("") # Empty line between message and comments.
8955                 edittext.append(_("HG: Enter commit message."
8956                                   "  Lines beginning with 'HG:' are removed."))
8957                 edittext.append("HG: --")
8958                 edittext.append("HG: user: %s" % user)
8959                 if p2 != nullid:
8960                     edittext.append("HG: branch merge")
8961                 if branchname:
8962                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
8963                 edittext.extend(["HG: added %s" % f for f in added])
8964                 edittext.extend(["HG: changed %s" % f for f in updated])
8965                 edittext.extend(["HG: removed %s" % f for f in removed])
8966                 if not added and not updated and not removed:
8967                     edittext.append("HG: no files changed")
8968                 edittext.append("")
8969                 # run editor in the repository root
8970 E               olddir = os.getcwd()
8971 >               OSError: [Errno 2] No such file or directory
8972 
8973 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
8974 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
8975 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
8976 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
8977 HG: --
8978 HG: user: nobody
8979 HG: branch 'default'
8980 HG: added ab56b4d92b40713acc5af89985d4b786
8981 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
8982 Vim: Beendet.
8983 ]2;Terminal - Terminal]1;Terminal - Terminal
8984 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
8985 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
8986 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
8987 
8988 transaction abort!
8989 rollback completed
8990 transaction abort!
8991 rollback completed
8992 
8993 - - - - -  test_create_revision_change_empty_meta: recorded stderr - - - - - -
8994 transaction abort!
8995 rollback completed
8996 
8997 ________________________________________________________________________________
8998  entrypoint: test_backends_hg.py TestMercurialBackend().test_change_meta_create_revision 
8999 
9000     def test_change_meta_create_revision(self):
9001         item = self.backend.create_item("double")
9002         item.change_metadata()
9003         item["meta"] = "data"
9004         item.publish_metadata()
9005         rev = item.create_revision(0)
9006         rev["revno"] = "0"
9007 >       item.commit()
9008 
9009 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:486]
9010 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9011 
9012     def commit(self):
9013         """
9014             @see: Backend._commit_item.__doc__
9015             """
9016         assert self._uncommitted_revision is not None
9017 >       self._backend._commit_item(self._uncommitted_revision)
9018 
9019 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
9020 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9021 
9022     def _commit_item(self, revision, second_parent=None):
9023         """
9024             Commit given Item Revision to repository. Update and commit Item index file.
9025             If Revision already exists, raise RevisionAlreadyExistsError.
9026             """
9027         item = revision.item
9028         lock = self._lock_repo() #XXX: lock item only!
9029         try:
9030             if not item._id:
9031                 self._add_item(item)
9032             elif revision.revno in self._list_revisions(item):
9033                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
9034     
9035             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
9036             if revision.revno > 0:
9037                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
9038                 if second_parent:
9039                     parents.append(second_parent)
9040             else:
9041                 self._open_item_index(item, 'wb').close()
9042                 self._repo.add([item._id, "%s.rev" % item._id])
9043                 parents = []
9044             internal_meta = {'rev': revision.revno,
9045                              'name': item.name,
9046                              'id': item._id,
9047                              'parents': " ".join(parents)}
9048             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
9049             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
9050     
9051             if not revision.timestamp:
9052                 revision.timestamp = long(time.time())
9053             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
9054             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
9055             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
9056             try:
9057                 match = mercurial.match.exact(self._rev_path, '', [item._id])
9058 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
9059 
9060 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
9061 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9062 
9063     def commit(self, files=None, text="", user=None, date=None,
9064                match=None, force=False, force_editor=False,
9065                p1=None, p2=None, extra={}, empty_ok=False):
9066         wlock = lock = None
9067         if extra.get("close"):
9068             force = True
9069         if files:
9070             files = util.unique(files)
9071         try:
9072             wlock = self.wlock()
9073             lock = self.lock()
9074             use_dirstate = (p1 is None) # not rawcommit
9075     
9076             if use_dirstate:
9077                 p1, p2 = self.dirstate.parents()
9078                 update_dirstate = True
9079     
9080                 if (not force and p2 != nullid and
9081                     (match and (match.files() or match.anypats()))):
9082                     raise util.Abort(_('cannot partially commit a merge '
9083                                        '(do not specify files or patterns)'))
9084     
9085                 if files:
9086                     modified, removed = [], []
9087                     for f in files:
9088                         s = self.dirstate[f]
9089                         if s in 'nma':
9090                             modified.append(f)
9091                         elif s == 'r':
9092                             removed.append(f)
9093                         else:
9094                             self.ui.warn(_("%s not tracked!\n") % f)
9095                     changes = [modified, [], removed, [], []]
9096                 else:
9097                     changes = self.status(match=match)
9098             else:
9099                 p1, p2 = p1, p2 or nullid
9100                 update_dirstate = (self.dirstate.parents()[0] == p1)
9101                 changes = [files, [], [], [], []]
9102     
9103             ms = merge_.mergestate(self)
9104             for f in changes[0]:
9105                 if f in ms and ms[f] == 'u':
9106                     raise util.Abort(_("unresolved merge conflicts "
9107                                                     "(see hg resolve)"))
9108             wctx = context.workingctx(self, (p1, p2), text, user, date,
9109                                       extra, changes)
9110             r = self._commitctx(wctx, force, force_editor, empty_ok,
9111 >                               use_dirstate, update_dirstate)
9112 
9113 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
9114 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9115 
9116     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
9117                   use_dirstate=True, update_dirstate=True):
9118         tr = None
9119         valid = 0 # don't save the dirstate if this isn't set
9120         try:
9121             commit = util.sort(wctx.modified() + wctx.added())
9122             remove = wctx.removed()
9123             extra = wctx.extra().copy()
9124             branchname = extra['branch']
9125             user = wctx.user()
9126             text = wctx.description()
9127     
9128             p1, p2 = [p.node() for p in wctx.parents()]
9129             c1 = self.changelog.read(p1)
9130             c2 = self.changelog.read(p2)
9131             m1 = self.manifest.read(c1[0]).copy()
9132             m2 = self.manifest.read(c2[0])
9133     
9134             if use_dirstate:
9135                 oldname = c1[5].get("branch") # stored in UTF-8
9136                 if (not commit and not remove and not force and p2 == nullid
9137                     and branchname == oldname):
9138                     self.ui.status(_("nothing changed\n"))
9139                     return None
9140     
9141             xp1 = hex(p1)
9142             if p2 == nullid: xp2 = ''
9143             else: xp2 = hex(p2)
9144     
9145             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
9146     
9147             tr = self.transaction()
9148             trp = weakref.proxy(tr)
9149     
9150             # check in files
9151             new = {}
9152             changed = []
9153             linkrev = len(self)
9154             for f in commit:
9155                 self.ui.note(f + "\n")
9156                 try:
9157                     fctx = wctx.filectx(f)
9158                     newflags = fctx.flags()
9159                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
9160                     if ((not changed or changed[-1] != f) and
9161                         m2.get(f) != new[f]):
9162                         # mention the file in the changelog if some
9163                         # flag changed, even if there was no content
9164                         # change.
9165                         if m1.flags(f) != newflags:
9166                             changed.append(f)
9167                     m1.set(f, newflags)
9168                     if use_dirstate:
9169                         self.dirstate.normal(f)
9170     
9171                 except (OSError, IOError):
9172                     if use_dirstate:
9173                         self.ui.warn(_("trouble committing %s!\n") % f)
9174                         raise
9175                     else:
9176                         remove.append(f)
9177     
9178             updated, added = [], []
9179             for f in util.sort(changed):
9180                 if f in m1 or f in m2:
9181                     updated.append(f)
9182                 else:
9183                     added.append(f)
9184     
9185             # update manifest
9186             m1.update(new)
9187             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
9188             removed1 = []
9189     
9190             for f in removed:
9191                 if f in m1:
9192                     del m1[f]
9193                     removed1.append(f)
9194             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
9195                                    (new, removed1))
9196     
9197             # add changeset
9198             if (not empty_ok and not text) or force_editor:
9199                 edittext = []
9200                 if text:
9201                     edittext.append(text)
9202                 edittext.append("")
9203                 edittext.append("") # Empty line between message and comments.
9204                 edittext.append(_("HG: Enter commit message."
9205                                   "  Lines beginning with 'HG:' are removed."))
9206                 edittext.append("HG: --")
9207                 edittext.append("HG: user: %s" % user)
9208                 if p2 != nullid:
9209                     edittext.append("HG: branch merge")
9210                 if branchname:
9211                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
9212                 edittext.extend(["HG: added %s" % f for f in added])
9213                 edittext.extend(["HG: changed %s" % f for f in updated])
9214                 edittext.extend(["HG: removed %s" % f for f in removed])
9215                 if not added and not updated and not removed:
9216                     edittext.append("HG: no files changed")
9217                 edittext.append("")
9218                 # run editor in the repository root
9219 E               olddir = os.getcwd()
9220 >               OSError: [Errno 2] No such file or directory
9221 
9222 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
9223 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
9224 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
9225 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
9226 HG: --
9227 HG: user: nobody
9228 HG: branch 'default'
9229 HG: added ab56b4d92b40713acc5af89985d4b786
9230 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
9231 Vim: Beendet.
9232 ]2;Terminal - Terminal]1;Terminal - Terminal
9233 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
9234 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
9235 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
9236 
9237 transaction abort!
9238 rollback completed
9239 transaction abort!
9240 rollback completed
9241 
9242 - - - - - - -  test_change_meta_create_revision: recorded stderr - - - - - - - -
9243 transaction abort!
9244 rollback completed
9245 
9246 ________________________________________________________________________________
9247  entrypoint: test_backends_hg.py TestMercurialBackend().test_long_names_back_and_forth 
9248 
9249     def test_long_names_back_and_forth(self):
9250         item = self.backend.create_item("long_name_" * 100 + "with_happy_end")
9251         item.create_revision(0)
9252 >       item.commit()
9253 
9254 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:503]
9255 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9256 
9257     def commit(self):
9258         """
9259             @see: Backend._commit_item.__doc__
9260             """
9261         assert self._uncommitted_revision is not None
9262 >       self._backend._commit_item(self._uncommitted_revision)
9263 
9264 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
9265 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9266 
9267     def _commit_item(self, revision, second_parent=None):
9268         """
9269             Commit given Item Revision to repository. Update and commit Item index file.
9270             If Revision already exists, raise RevisionAlreadyExistsError.
9271             """
9272         item = revision.item
9273         lock = self._lock_repo() #XXX: lock item only!
9274         try:
9275             if not item._id:
9276                 self._add_item(item)
9277             elif revision.revno in self._list_revisions(item):
9278                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
9279     
9280             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
9281             if revision.revno > 0:
9282                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
9283                 if second_parent:
9284                     parents.append(second_parent)
9285             else:
9286                 self._open_item_index(item, 'wb').close()
9287                 self._repo.add([item._id, "%s.rev" % item._id])
9288                 parents = []
9289             internal_meta = {'rev': revision.revno,
9290                              'name': item.name,
9291                              'id': item._id,
9292                              'parents': " ".join(parents)}
9293             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
9294             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
9295     
9296             if not revision.timestamp:
9297                 revision.timestamp = long(time.time())
9298             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
9299             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
9300             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
9301             try:
9302                 match = mercurial.match.exact(self._rev_path, '', [item._id])
9303 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
9304 
9305 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
9306 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9307 
9308     def commit(self, files=None, text="", user=None, date=None,
9309                match=None, force=False, force_editor=False,
9310                p1=None, p2=None, extra={}, empty_ok=False):
9311         wlock = lock = None
9312         if extra.get("close"):
9313             force = True
9314         if files:
9315             files = util.unique(files)
9316         try:
9317             wlock = self.wlock()
9318             lock = self.lock()
9319             use_dirstate = (p1 is None) # not rawcommit
9320     
9321             if use_dirstate:
9322                 p1, p2 = self.dirstate.parents()
9323                 update_dirstate = True
9324     
9325                 if (not force and p2 != nullid and
9326                     (match and (match.files() or match.anypats()))):
9327                     raise util.Abort(_('cannot partially commit a merge '
9328                                        '(do not specify files or patterns)'))
9329     
9330                 if files:
9331                     modified, removed = [], []
9332                     for f in files:
9333                         s = self.dirstate[f]
9334                         if s in 'nma':
9335                             modified.append(f)
9336                         elif s == 'r':
9337                             removed.append(f)
9338                         else:
9339                             self.ui.warn(_("%s not tracked!\n") % f)
9340                     changes = [modified, [], removed, [], []]
9341                 else:
9342                     changes = self.status(match=match)
9343             else:
9344                 p1, p2 = p1, p2 or nullid
9345                 update_dirstate = (self.dirstate.parents()[0] == p1)
9346                 changes = [files, [], [], [], []]
9347     
9348             ms = merge_.mergestate(self)
9349             for f in changes[0]:
9350                 if f in ms and ms[f] == 'u':
9351                     raise util.Abort(_("unresolved merge conflicts "
9352                                                     "(see hg resolve)"))
9353             wctx = context.workingctx(self, (p1, p2), text, user, date,
9354                                       extra, changes)
9355             r = self._commitctx(wctx, force, force_editor, empty_ok,
9356 >                               use_dirstate, update_dirstate)
9357 
9358 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
9359 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9360 
9361     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
9362                   use_dirstate=True, update_dirstate=True):
9363         tr = None
9364         valid = 0 # don't save the dirstate if this isn't set
9365         try:
9366             commit = util.sort(wctx.modified() + wctx.added())
9367             remove = wctx.removed()
9368             extra = wctx.extra().copy()
9369             branchname = extra['branch']
9370             user = wctx.user()
9371             text = wctx.description()
9372     
9373             p1, p2 = [p.node() for p in wctx.parents()]
9374             c1 = self.changelog.read(p1)
9375             c2 = self.changelog.read(p2)
9376             m1 = self.manifest.read(c1[0]).copy()
9377             m2 = self.manifest.read(c2[0])
9378     
9379             if use_dirstate:
9380                 oldname = c1[5].get("branch") # stored in UTF-8
9381                 if (not commit and not remove and not force and p2 == nullid
9382                     and branchname == oldname):
9383                     self.ui.status(_("nothing changed\n"))
9384                     return None
9385     
9386             xp1 = hex(p1)
9387             if p2 == nullid: xp2 = ''
9388             else: xp2 = hex(p2)
9389     
9390             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
9391     
9392             tr = self.transaction()
9393             trp = weakref.proxy(tr)
9394     
9395             # check in files
9396             new = {}
9397             changed = []
9398             linkrev = len(self)
9399             for f in commit:
9400                 self.ui.note(f + "\n")
9401                 try:
9402                     fctx = wctx.filectx(f)
9403                     newflags = fctx.flags()
9404                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
9405                     if ((not changed or changed[-1] != f) and
9406                         m2.get(f) != new[f]):
9407                         # mention the file in the changelog if some
9408                         # flag changed, even if there was no content
9409                         # change.
9410                         if m1.flags(f) != newflags:
9411                             changed.append(f)
9412                     m1.set(f, newflags)
9413                     if use_dirstate:
9414                         self.dirstate.normal(f)
9415     
9416                 except (OSError, IOError):
9417                     if use_dirstate:
9418                         self.ui.warn(_("trouble committing %s!\n") % f)
9419                         raise
9420                     else:
9421                         remove.append(f)
9422     
9423             updated, added = [], []
9424             for f in util.sort(changed):
9425                 if f in m1 or f in m2:
9426                     updated.append(f)
9427                 else:
9428                     added.append(f)
9429     
9430             # update manifest
9431             m1.update(new)
9432             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
9433             removed1 = []
9434     
9435             for f in removed:
9436                 if f in m1:
9437                     del m1[f]
9438                     removed1.append(f)
9439             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
9440                                    (new, removed1))
9441     
9442             # add changeset
9443             if (not empty_ok and not text) or force_editor:
9444                 edittext = []
9445                 if text:
9446                     edittext.append(text)
9447                 edittext.append("")
9448                 edittext.append("") # Empty line between message and comments.
9449                 edittext.append(_("HG: Enter commit message."
9450                                   "  Lines beginning with 'HG:' are removed."))
9451                 edittext.append("HG: --")
9452                 edittext.append("HG: user: %s" % user)
9453                 if p2 != nullid:
9454                     edittext.append("HG: branch merge")
9455                 if branchname:
9456                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
9457                 edittext.extend(["HG: added %s" % f for f in added])
9458                 edittext.extend(["HG: changed %s" % f for f in updated])
9459                 edittext.extend(["HG: removed %s" % f for f in removed])
9460                 if not added and not updated and not removed:
9461                     edittext.append("HG: no files changed")
9462                 edittext.append("")
9463                 # run editor in the repository root
9464 E               olddir = os.getcwd()
9465 >               OSError: [Errno 2] No such file or directory
9466 
9467 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
9468 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
9469 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
9470 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
9471 HG: --
9472 HG: user: nobody
9473 HG: branch 'default'
9474 HG: added ab56b4d92b40713acc5af89985d4b786
9475 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
9476 Vim: Beendet.
9477 ]2;Terminal - Terminal]1;Terminal - Terminal
9478 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
9479 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
9480 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
9481 
9482 transaction abort!
9483 rollback completed
9484 transaction abort!
9485 rollback completed
9486 
9487 - - - - - - -  test_long_names_back_and_forth: recorded stderr - - - - - - - -
9488 transaction abort!
9489 rollback completed
9490 
9491 ________________________________________________________________________________
9492  entrypoint: test_backends_hg.py TestMercurialBackend().test_revisions_after_rename 
9493 
9494     def test_revisions_after_rename(self):
9495         item = self.backend.create_item("first one")
9496         for revno in xrange(10):
9497             rev = item.create_revision(revno)
9498             rev["revno"] = str(revno)
9499 >           item.commit()
9500 
9501 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:513]
9502 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9503 
9504     def commit(self):
9505         """
9506             @see: Backend._commit_item.__doc__
9507             """
9508         assert self._uncommitted_revision is not None
9509 >       self._backend._commit_item(self._uncommitted_revision)
9510 
9511 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
9512 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9513 
9514     def _commit_item(self, revision, second_parent=None):
9515         """
9516             Commit given Item Revision to repository. Update and commit Item index file.
9517             If Revision already exists, raise RevisionAlreadyExistsError.
9518             """
9519         item = revision.item
9520         lock = self._lock_repo() #XXX: lock item only!
9521         try:
9522             if not item._id:
9523                 self._add_item(item)
9524             elif revision.revno in self._list_revisions(item):
9525                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
9526     
9527             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
9528             if revision.revno > 0:
9529                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
9530                 if second_parent:
9531                     parents.append(second_parent)
9532             else:
9533                 self._open_item_index(item, 'wb').close()
9534                 self._repo.add([item._id, "%s.rev" % item._id])
9535                 parents = []
9536             internal_meta = {'rev': revision.revno,
9537                              'name': item.name,
9538                              'id': item._id,
9539                              'parents': " ".join(parents)}
9540             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
9541             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
9542     
9543             if not revision.timestamp:
9544                 revision.timestamp = long(time.time())
9545             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
9546             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
9547             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
9548             try:
9549                 match = mercurial.match.exact(self._rev_path, '', [item._id])
9550 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
9551 
9552 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
9553 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9554 
9555     def commit(self, files=None, text="", user=None, date=None,
9556                match=None, force=False, force_editor=False,
9557                p1=None, p2=None, extra={}, empty_ok=False):
9558         wlock = lock = None
9559         if extra.get("close"):
9560             force = True
9561         if files:
9562             files = util.unique(files)
9563         try:
9564             wlock = self.wlock()
9565             lock = self.lock()
9566             use_dirstate = (p1 is None) # not rawcommit
9567     
9568             if use_dirstate:
9569                 p1, p2 = self.dirstate.parents()
9570                 update_dirstate = True
9571     
9572                 if (not force and p2 != nullid and
9573                     (match and (match.files() or match.anypats()))):
9574                     raise util.Abort(_('cannot partially commit a merge '
9575                                        '(do not specify files or patterns)'))
9576     
9577                 if files:
9578                     modified, removed = [], []
9579                     for f in files:
9580                         s = self.dirstate[f]
9581                         if s in 'nma':
9582                             modified.append(f)
9583                         elif s == 'r':
9584                             removed.append(f)
9585                         else:
9586                             self.ui.warn(_("%s not tracked!\n") % f)
9587                     changes = [modified, [], removed, [], []]
9588                 else:
9589                     changes = self.status(match=match)
9590             else:
9591                 p1, p2 = p1, p2 or nullid
9592                 update_dirstate = (self.dirstate.parents()[0] == p1)
9593                 changes = [files, [], [], [], []]
9594     
9595             ms = merge_.mergestate(self)
9596             for f in changes[0]:
9597                 if f in ms and ms[f] == 'u':
9598                     raise util.Abort(_("unresolved merge conflicts "
9599                                                     "(see hg resolve)"))
9600             wctx = context.workingctx(self, (p1, p2), text, user, date,
9601                                       extra, changes)
9602             r = self._commitctx(wctx, force, force_editor, empty_ok,
9603 >                               use_dirstate, update_dirstate)
9604 
9605 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
9606 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9607 
9608     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
9609                   use_dirstate=True, update_dirstate=True):
9610         tr = None
9611         valid = 0 # don't save the dirstate if this isn't set
9612         try:
9613             commit = util.sort(wctx.modified() + wctx.added())
9614             remove = wctx.removed()
9615             extra = wctx.extra().copy()
9616             branchname = extra['branch']
9617             user = wctx.user()
9618             text = wctx.description()
9619     
9620             p1, p2 = [p.node() for p in wctx.parents()]
9621             c1 = self.changelog.read(p1)
9622             c2 = self.changelog.read(p2)
9623             m1 = self.manifest.read(c1[0]).copy()
9624             m2 = self.manifest.read(c2[0])
9625     
9626             if use_dirstate:
9627                 oldname = c1[5].get("branch") # stored in UTF-8
9628                 if (not commit and not remove and not force and p2 == nullid
9629                     and branchname == oldname):
9630                     self.ui.status(_("nothing changed\n"))
9631                     return None
9632     
9633             xp1 = hex(p1)
9634             if p2 == nullid: xp2 = ''
9635             else: xp2 = hex(p2)
9636     
9637             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
9638     
9639             tr = self.transaction()
9640             trp = weakref.proxy(tr)
9641     
9642             # check in files
9643             new = {}
9644             changed = []
9645             linkrev = len(self)
9646             for f in commit:
9647                 self.ui.note(f + "\n")
9648                 try:
9649                     fctx = wctx.filectx(f)
9650                     newflags = fctx.flags()
9651                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
9652                     if ((not changed or changed[-1] != f) and
9653                         m2.get(f) != new[f]):
9654                         # mention the file in the changelog if some
9655                         # flag changed, even if there was no content
9656                         # change.
9657                         if m1.flags(f) != newflags:
9658                             changed.append(f)
9659                     m1.set(f, newflags)
9660                     if use_dirstate:
9661                         self.dirstate.normal(f)
9662     
9663                 except (OSError, IOError):
9664                     if use_dirstate:
9665                         self.ui.warn(_("trouble committing %s!\n") % f)
9666                         raise
9667                     else:
9668                         remove.append(f)
9669     
9670             updated, added = [], []
9671             for f in util.sort(changed):
9672                 if f in m1 or f in m2:
9673                     updated.append(f)
9674                 else:
9675                     added.append(f)
9676     
9677             # update manifest
9678             m1.update(new)
9679             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
9680             removed1 = []
9681     
9682             for f in removed:
9683                 if f in m1:
9684                     del m1[f]
9685                     removed1.append(f)
9686             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
9687                                    (new, removed1))
9688     
9689             # add changeset
9690             if (not empty_ok and not text) or force_editor:
9691                 edittext = []
9692                 if text:
9693                     edittext.append(text)
9694                 edittext.append("")
9695                 edittext.append("") # Empty line between message and comments.
9696                 edittext.append(_("HG: Enter commit message."
9697                                   "  Lines beginning with 'HG:' are removed."))
9698                 edittext.append("HG: --")
9699                 edittext.append("HG: user: %s" % user)
9700                 if p2 != nullid:
9701                     edittext.append("HG: branch merge")
9702                 if branchname:
9703                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
9704                 edittext.extend(["HG: added %s" % f for f in added])
9705                 edittext.extend(["HG: changed %s" % f for f in updated])
9706                 edittext.extend(["HG: removed %s" % f for f in removed])
9707                 if not added and not updated and not removed:
9708                     edittext.append("HG: no files changed")
9709                 edittext.append("")
9710                 # run editor in the repository root
9711 E               olddir = os.getcwd()
9712 >               OSError: [Errno 2] No such file or directory
9713 
9714 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
9715 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
9716 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
9717 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
9718 HG: --
9719 HG: user: nobody
9720 HG: branch 'default'
9721 HG: added ab56b4d92b40713acc5af89985d4b786
9722 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
9723 Vim: Beendet.
9724 ]2;Terminal - Terminal]1;Terminal - Terminal
9725 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
9726 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
9727 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
9728 
9729 transaction abort!
9730 rollback completed
9731 transaction abort!
9732 rollback completed
9733 
9734 - - - - - - - -  test_revisions_after_rename: recorded stderr - - - - - - - - -
9735 transaction abort!
9736 rollback completed
9737 
9738 ________________________________________________________________________________
9739  entrypoint: test_backends_hg.py TestMercurialBackend().test_concurrent_create_revision 
9740 
9741     def test_concurrent_create_revision(self):
9742 >       self.create_rev_item_helper("concurrent")
9743 
9744 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:529]
9745 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9746 
9747     def create_rev_item_helper(self, name):
9748         item = self.backend.create_item(name)
9749         item.create_revision(0)
9750 >       item.commit()
9751 
9752 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:56]
9753 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9754 
9755     def commit(self):
9756         """
9757             @see: Backend._commit_item.__doc__
9758             """
9759         assert self._uncommitted_revision is not None
9760 >       self._backend._commit_item(self._uncommitted_revision)
9761 
9762 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
9763 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9764 
9765     def _commit_item(self, revision, second_parent=None):
9766         """
9767             Commit given Item Revision to repository. Update and commit Item index file.
9768             If Revision already exists, raise RevisionAlreadyExistsError.
9769             """
9770         item = revision.item
9771         lock = self._lock_repo() #XXX: lock item only!
9772         try:
9773             if not item._id:
9774                 self._add_item(item)
9775             elif revision.revno in self._list_revisions(item):
9776                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
9777     
9778             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
9779             if revision.revno > 0:
9780                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
9781                 if second_parent:
9782                     parents.append(second_parent)
9783             else:
9784                 self._open_item_index(item, 'wb').close()
9785                 self._repo.add([item._id, "%s.rev" % item._id])
9786                 parents = []
9787             internal_meta = {'rev': revision.revno,
9788                              'name': item.name,
9789                              'id': item._id,
9790                              'parents': " ".join(parents)}
9791             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
9792             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
9793     
9794             if not revision.timestamp:
9795                 revision.timestamp = long(time.time())
9796             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
9797             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
9798             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
9799             try:
9800                 match = mercurial.match.exact(self._rev_path, '', [item._id])
9801 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
9802 
9803 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
9804 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9805 
9806     def commit(self, files=None, text="", user=None, date=None,
9807                match=None, force=False, force_editor=False,
9808                p1=None, p2=None, extra={}, empty_ok=False):
9809         wlock = lock = None
9810         if extra.get("close"):
9811             force = True
9812         if files:
9813             files = util.unique(files)
9814         try:
9815             wlock = self.wlock()
9816             lock = self.lock()
9817             use_dirstate = (p1 is None) # not rawcommit
9818     
9819             if use_dirstate:
9820                 p1, p2 = self.dirstate.parents()
9821                 update_dirstate = True
9822     
9823                 if (not force and p2 != nullid and
9824                     (match and (match.files() or match.anypats()))):
9825                     raise util.Abort(_('cannot partially commit a merge '
9826                                        '(do not specify files or patterns)'))
9827     
9828                 if files:
9829                     modified, removed = [], []
9830                     for f in files:
9831                         s = self.dirstate[f]
9832                         if s in 'nma':
9833                             modified.append(f)
9834                         elif s == 'r':
9835                             removed.append(f)
9836                         else:
9837                             self.ui.warn(_("%s not tracked!\n") % f)
9838                     changes = [modified, [], removed, [], []]
9839                 else:
9840                     changes = self.status(match=match)
9841             else:
9842                 p1, p2 = p1, p2 or nullid
9843                 update_dirstate = (self.dirstate.parents()[0] == p1)
9844                 changes = [files, [], [], [], []]
9845     
9846             ms = merge_.mergestate(self)
9847             for f in changes[0]:
9848                 if f in ms and ms[f] == 'u':
9849                     raise util.Abort(_("unresolved merge conflicts "
9850                                                     "(see hg resolve)"))
9851             wctx = context.workingctx(self, (p1, p2), text, user, date,
9852                                       extra, changes)
9853             r = self._commitctx(wctx, force, force_editor, empty_ok,
9854 >                               use_dirstate, update_dirstate)
9855 
9856 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
9857 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
9858 
9859     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
9860                   use_dirstate=True, update_dirstate=True):
9861         tr = None
9862         valid = 0 # don't save the dirstate if this isn't set
9863         try:
9864             commit = util.sort(wctx.modified() + wctx.added())
9865             remove = wctx.removed()
9866             extra = wctx.extra().copy()
9867             branchname = extra['branch']
9868             user = wctx.user()
9869             text = wctx.description()
9870     
9871             p1, p2 = [p.node() for p in wctx.parents()]
9872             c1 = self.changelog.read(p1)
9873             c2 = self.changelog.read(p2)
9874             m1 = self.manifest.read(c1[0]).copy()
9875             m2 = self.manifest.read(c2[0])
9876     
9877             if use_dirstate:
9878                 oldname = c1[5].get("branch") # stored in UTF-8
9879                 if (not commit and not remove and not force and p2 == nullid
9880                     and branchname == oldname):
9881                     self.ui.status(_("nothing changed\n"))
9882                     return None
9883     
9884             xp1 = hex(p1)
9885             if p2 == nullid: xp2 = ''
9886             else: xp2 = hex(p2)
9887     
9888             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
9889     
9890             tr = self.transaction()
9891             trp = weakref.proxy(tr)
9892     
9893             # check in files
9894             new = {}
9895             changed = []
9896             linkrev = len(self)
9897             for f in commit:
9898                 self.ui.note(f + "\n")
9899                 try:
9900                     fctx = wctx.filectx(f)
9901                     newflags = fctx.flags()
9902                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
9903                     if ((not changed or changed[-1] != f) and
9904                         m2.get(f) != new[f]):
9905                         # mention the file in the changelog if some
9906                         # flag changed, even if there was no content
9907                         # change.
9908                         if m1.flags(f) != newflags:
9909                             changed.append(f)
9910                     m1.set(f, newflags)
9911                     if use_dirstate:
9912                         self.dirstate.normal(f)
9913     
9914                 except (OSError, IOError):
9915                     if use_dirstate:
9916                         self.ui.warn(_("trouble committing %s!\n") % f)
9917                         raise
9918                     else:
9919                         remove.append(f)
9920     
9921             updated, added = [], []
9922             for f in util.sort(changed):
9923                 if f in m1 or f in m2:
9924                     updated.append(f)
9925                 else:
9926                     added.append(f)
9927     
9928             # update manifest
9929             m1.update(new)
9930             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
9931             removed1 = []
9932     
9933             for f in removed:
9934                 if f in m1:
9935                     del m1[f]
9936                     removed1.append(f)
9937             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
9938                                    (new, removed1))
9939     
9940             # add changeset
9941             if (not empty_ok and not text) or force_editor:
9942                 edittext = []
9943                 if text:
9944                     edittext.append(text)
9945                 edittext.append("")
9946                 edittext.append("") # Empty line between message and comments.
9947                 edittext.append(_("HG: Enter commit message."
9948                                   "  Lines beginning with 'HG:' are removed."))
9949                 edittext.append("HG: --")
9950                 edittext.append("HG: user: %s" % user)
9951                 if p2 != nullid:
9952                     edittext.append("HG: branch merge")
9953                 if branchname:
9954                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
9955                 edittext.extend(["HG: added %s" % f for f in added])
9956                 edittext.extend(["HG: changed %s" % f for f in updated])
9957                 edittext.extend(["HG: removed %s" % f for f in removed])
9958                 if not added and not updated and not removed:
9959                     edittext.append("HG: no files changed")
9960                 edittext.append("")
9961                 # run editor in the repository root
9962 E               olddir = os.getcwd()
9963 >               OSError: [Errno 2] No such file or directory
9964 
9965 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
9966 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
9967 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
9968 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
9969 HG: --
9970 HG: user: nobody
9971 HG: branch 'default'
9972 HG: added ab56b4d92b40713acc5af89985d4b786
9973 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
9974 Vim: Beendet.
9975 ]2;Terminal - Terminal]1;Terminal - Terminal
9976 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
9977 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
9978 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
9979 
9980 transaction abort!
9981 rollback completed
9982 transaction abort!
9983 rollback completed
9984 
9985 - - - - - - -  test_concurrent_create_revision: recorded stderr - - - - - - - -
9986 transaction abort!
9987 rollback completed
9988 
9989 ________________________________________________________________________________
9990 ____ entrypoint: test_backends_hg.py TestMercurialBackend().test_timestamp _____
9991 
9992     def test_timestamp(self):
9993         item = self.backend.create_item('ts1')
9994         rev = item.create_revision(0)
9995         assert rev.timestamp is None
9996 >       item.commit()
9997 
9998 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:541]
9999 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10000 
10001     def commit(self):
10002         """
10003             @see: Backend._commit_item.__doc__
10004             """
10005         assert self._uncommitted_revision is not None
10006 >       self._backend._commit_item(self._uncommitted_revision)
10007 
10008 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
10009 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10010 
10011     def _commit_item(self, revision, second_parent=None):
10012         """
10013             Commit given Item Revision to repository. Update and commit Item index file.
10014             If Revision already exists, raise RevisionAlreadyExistsError.
10015             """
10016         item = revision.item
10017         lock = self._lock_repo() #XXX: lock item only!
10018         try:
10019             if not item._id:
10020                 self._add_item(item)
10021             elif revision.revno in self._list_revisions(item):
10022                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
10023     
10024             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
10025             if revision.revno > 0:
10026                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
10027                 if second_parent:
10028                     parents.append(second_parent)
10029             else:
10030                 self._open_item_index(item, 'wb').close()
10031                 self._repo.add([item._id, "%s.rev" % item._id])
10032                 parents = []
10033             internal_meta = {'rev': revision.revno,
10034                              'name': item.name,
10035                              'id': item._id,
10036                              'parents': " ".join(parents)}
10037             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
10038             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
10039     
10040             if not revision.timestamp:
10041                 revision.timestamp = long(time.time())
10042             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
10043             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
10044             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
10045             try:
10046                 match = mercurial.match.exact(self._rev_path, '', [item._id])
10047 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
10048 
10049 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
10050 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10051 
10052     def commit(self, files=None, text="", user=None, date=None,
10053                match=None, force=False, force_editor=False,
10054                p1=None, p2=None, extra={}, empty_ok=False):
10055         wlock = lock = None
10056         if extra.get("close"):
10057             force = True
10058         if files:
10059             files = util.unique(files)
10060         try:
10061             wlock = self.wlock()
10062             lock = self.lock()
10063             use_dirstate = (p1 is None) # not rawcommit
10064     
10065             if use_dirstate:
10066                 p1, p2 = self.dirstate.parents()
10067                 update_dirstate = True
10068     
10069                 if (not force and p2 != nullid and
10070                     (match and (match.files() or match.anypats()))):
10071                     raise util.Abort(_('cannot partially commit a merge '
10072                                        '(do not specify files or patterns)'))
10073     
10074                 if files:
10075                     modified, removed = [], []
10076                     for f in files:
10077                         s = self.dirstate[f]
10078                         if s in 'nma':
10079                             modified.append(f)
10080                         elif s == 'r':
10081                             removed.append(f)
10082                         else:
10083                             self.ui.warn(_("%s not tracked!\n") % f)
10084                     changes = [modified, [], removed, [], []]
10085                 else:
10086                     changes = self.status(match=match)
10087             else:
10088                 p1, p2 = p1, p2 or nullid
10089                 update_dirstate = (self.dirstate.parents()[0] == p1)
10090                 changes = [files, [], [], [], []]
10091     
10092             ms = merge_.mergestate(self)
10093             for f in changes[0]:
10094                 if f in ms and ms[f] == 'u':
10095                     raise util.Abort(_("unresolved merge conflicts "
10096                                                     "(see hg resolve)"))
10097             wctx = context.workingctx(self, (p1, p2), text, user, date,
10098                                       extra, changes)
10099             r = self._commitctx(wctx, force, force_editor, empty_ok,
10100 >                               use_dirstate, update_dirstate)
10101 
10102 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
10103 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10104 
10105     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
10106                   use_dirstate=True, update_dirstate=True):
10107         tr = None
10108         valid = 0 # don't save the dirstate if this isn't set
10109         try:
10110             commit = util.sort(wctx.modified() + wctx.added())
10111             remove = wctx.removed()
10112             extra = wctx.extra().copy()
10113             branchname = extra['branch']
10114             user = wctx.user()
10115             text = wctx.description()
10116     
10117             p1, p2 = [p.node() for p in wctx.parents()]
10118             c1 = self.changelog.read(p1)
10119             c2 = self.changelog.read(p2)
10120             m1 = self.manifest.read(c1[0]).copy()
10121             m2 = self.manifest.read(c2[0])
10122     
10123             if use_dirstate:
10124                 oldname = c1[5].get("branch") # stored in UTF-8
10125                 if (not commit and not remove and not force and p2 == nullid
10126                     and branchname == oldname):
10127                     self.ui.status(_("nothing changed\n"))
10128                     return None
10129     
10130             xp1 = hex(p1)
10131             if p2 == nullid: xp2 = ''
10132             else: xp2 = hex(p2)
10133     
10134             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
10135     
10136             tr = self.transaction()
10137             trp = weakref.proxy(tr)
10138     
10139             # check in files
10140             new = {}
10141             changed = []
10142             linkrev = len(self)
10143             for f in commit:
10144                 self.ui.note(f + "\n")
10145                 try:
10146                     fctx = wctx.filectx(f)
10147                     newflags = fctx.flags()
10148                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
10149                     if ((not changed or changed[-1] != f) and
10150                         m2.get(f) != new[f]):
10151                         # mention the file in the changelog if some
10152                         # flag changed, even if there was no content
10153                         # change.
10154                         if m1.flags(f) != newflags:
10155                             changed.append(f)
10156                     m1.set(f, newflags)
10157                     if use_dirstate:
10158                         self.dirstate.normal(f)
10159     
10160                 except (OSError, IOError):
10161                     if use_dirstate:
10162                         self.ui.warn(_("trouble committing %s!\n") % f)
10163                         raise
10164                     else:
10165                         remove.append(f)
10166     
10167             updated, added = [], []
10168             for f in util.sort(changed):
10169                 if f in m1 or f in m2:
10170                     updated.append(f)
10171                 else:
10172                     added.append(f)
10173     
10174             # update manifest
10175             m1.update(new)
10176             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
10177             removed1 = []
10178     
10179             for f in removed:
10180                 if f in m1:
10181                     del m1[f]
10182                     removed1.append(f)
10183             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
10184                                    (new, removed1))
10185     
10186             # add changeset
10187             if (not empty_ok and not text) or force_editor:
10188                 edittext = []
10189                 if text:
10190                     edittext.append(text)
10191                 edittext.append("")
10192                 edittext.append("") # Empty line between message and comments.
10193                 edittext.append(_("HG: Enter commit message."
10194                                   "  Lines beginning with 'HG:' are removed."))
10195                 edittext.append("HG: --")
10196                 edittext.append("HG: user: %s" % user)
10197                 if p2 != nullid:
10198                     edittext.append("HG: branch merge")
10199                 if branchname:
10200                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
10201                 edittext.extend(["HG: added %s" % f for f in added])
10202                 edittext.extend(["HG: changed %s" % f for f in updated])
10203                 edittext.extend(["HG: removed %s" % f for f in removed])
10204                 if not added and not updated and not removed:
10205                     edittext.append("HG: no files changed")
10206                 edittext.append("")
10207                 # run editor in the repository root
10208 E               olddir = os.getcwd()
10209 >               OSError: [Errno 2] No such file or directory
10210 
10211 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
10212 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
10213 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
10214 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
10215 HG: --
10216 HG: user: nobody
10217 HG: branch 'default'
10218 HG: added ab56b4d92b40713acc5af89985d4b786
10219 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
10220 Vim: Beendet.
10221 ]2;Terminal - Terminal]1;Terminal - Terminal
10222 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
10223 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
10224 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
10225 
10226 transaction abort!
10227 rollback completed
10228 transaction abort!
10229 rollback completed
10230 
10231 - - - - - - - - - - -  test_timestamp: recorded stderr - - - - - - - - - - - -
10232 transaction abort!
10233 rollback completed
10234 
10235 ________________________________________________________________________________
10236 _______ entrypoint: test_backends_hg.py TestMercurialBackend().test_size _______
10237 
10238     def test_size(self):
10239         item = self.backend.create_item('size1')
10240         rev = item.create_revision(0)
10241         rev.write('asdf')
10242         assert rev.size == 4
10243         rev.write('asdf')
10244         assert rev.size == 8
10245 >       item.commit()
10246 
10247 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:553]
10248 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10249 
10250     def commit(self):
10251         """
10252             @see: Backend._commit_item.__doc__
10253             """
10254         assert self._uncommitted_revision is not None
10255 >       self._backend._commit_item(self._uncommitted_revision)
10256 
10257 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
10258 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10259 
10260     def _commit_item(self, revision, second_parent=None):
10261         """
10262             Commit given Item Revision to repository. Update and commit Item index file.
10263             If Revision already exists, raise RevisionAlreadyExistsError.
10264             """
10265         item = revision.item
10266         lock = self._lock_repo() #XXX: lock item only!
10267         try:
10268             if not item._id:
10269                 self._add_item(item)
10270             elif revision.revno in self._list_revisions(item):
10271                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
10272     
10273             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
10274             if revision.revno > 0:
10275                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
10276                 if second_parent:
10277                     parents.append(second_parent)
10278             else:
10279                 self._open_item_index(item, 'wb').close()
10280                 self._repo.add([item._id, "%s.rev" % item._id])
10281                 parents = []
10282             internal_meta = {'rev': revision.revno,
10283                              'name': item.name,
10284                              'id': item._id,
10285                              'parents': " ".join(parents)}
10286             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
10287             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
10288     
10289             if not revision.timestamp:
10290                 revision.timestamp = long(time.time())
10291             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
10292             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
10293             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
10294             try:
10295                 match = mercurial.match.exact(self._rev_path, '', [item._id])
10296 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
10297 
10298 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
10299 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10300 
10301     def commit(self, files=None, text="", user=None, date=None,
10302                match=None, force=False, force_editor=False,
10303                p1=None, p2=None, extra={}, empty_ok=False):
10304         wlock = lock = None
10305         if extra.get("close"):
10306             force = True
10307         if files:
10308             files = util.unique(files)
10309         try:
10310             wlock = self.wlock()
10311             lock = self.lock()
10312             use_dirstate = (p1 is None) # not rawcommit
10313     
10314             if use_dirstate:
10315                 p1, p2 = self.dirstate.parents()
10316                 update_dirstate = True
10317     
10318                 if (not force and p2 != nullid and
10319                     (match and (match.files() or match.anypats()))):
10320                     raise util.Abort(_('cannot partially commit a merge '
10321                                        '(do not specify files or patterns)'))
10322     
10323                 if files:
10324                     modified, removed = [], []
10325                     for f in files:
10326                         s = self.dirstate[f]
10327                         if s in 'nma':
10328                             modified.append(f)
10329                         elif s == 'r':
10330                             removed.append(f)
10331                         else:
10332                             self.ui.warn(_("%s not tracked!\n") % f)
10333                     changes = [modified, [], removed, [], []]
10334                 else:
10335                     changes = self.status(match=match)
10336             else:
10337                 p1, p2 = p1, p2 or nullid
10338                 update_dirstate = (self.dirstate.parents()[0] == p1)
10339                 changes = [files, [], [], [], []]
10340     
10341             ms = merge_.mergestate(self)
10342             for f in changes[0]:
10343                 if f in ms and ms[f] == 'u':
10344                     raise util.Abort(_("unresolved merge conflicts "
10345                                                     "(see hg resolve)"))
10346             wctx = context.workingctx(self, (p1, p2), text, user, date,
10347                                       extra, changes)
10348             r = self._commitctx(wctx, force, force_editor, empty_ok,
10349 >                               use_dirstate, update_dirstate)
10350 
10351 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
10352 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10353 
10354     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
10355                   use_dirstate=True, update_dirstate=True):
10356         tr = None
10357         valid = 0 # don't save the dirstate if this isn't set
10358         try:
10359             commit = util.sort(wctx.modified() + wctx.added())
10360             remove = wctx.removed()
10361             extra = wctx.extra().copy()
10362             branchname = extra['branch']
10363             user = wctx.user()
10364             text = wctx.description()
10365     
10366             p1, p2 = [p.node() for p in wctx.parents()]
10367             c1 = self.changelog.read(p1)
10368             c2 = self.changelog.read(p2)
10369             m1 = self.manifest.read(c1[0]).copy()
10370             m2 = self.manifest.read(c2[0])
10371     
10372             if use_dirstate:
10373                 oldname = c1[5].get("branch") # stored in UTF-8
10374                 if (not commit and not remove and not force and p2 == nullid
10375                     and branchname == oldname):
10376                     self.ui.status(_("nothing changed\n"))
10377                     return None
10378     
10379             xp1 = hex(p1)
10380             if p2 == nullid: xp2 = ''
10381             else: xp2 = hex(p2)
10382     
10383             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
10384     
10385             tr = self.transaction()
10386             trp = weakref.proxy(tr)
10387     
10388             # check in files
10389             new = {}
10390             changed = []
10391             linkrev = len(self)
10392             for f in commit:
10393                 self.ui.note(f + "\n")
10394                 try:
10395                     fctx = wctx.filectx(f)
10396                     newflags = fctx.flags()
10397                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
10398                     if ((not changed or changed[-1] != f) and
10399                         m2.get(f) != new[f]):
10400                         # mention the file in the changelog if some
10401                         # flag changed, even if there was no content
10402                         # change.
10403                         if m1.flags(f) != newflags:
10404                             changed.append(f)
10405                     m1.set(f, newflags)
10406                     if use_dirstate:
10407                         self.dirstate.normal(f)
10408     
10409                 except (OSError, IOError):
10410                     if use_dirstate:
10411                         self.ui.warn(_("trouble committing %s!\n") % f)
10412                         raise
10413                     else:
10414                         remove.append(f)
10415     
10416             updated, added = [], []
10417             for f in util.sort(changed):
10418                 if f in m1 or f in m2:
10419                     updated.append(f)
10420                 else:
10421                     added.append(f)
10422     
10423             # update manifest
10424             m1.update(new)
10425             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
10426             removed1 = []
10427     
10428             for f in removed:
10429                 if f in m1:
10430                     del m1[f]
10431                     removed1.append(f)
10432             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
10433                                    (new, removed1))
10434     
10435             # add changeset
10436             if (not empty_ok and not text) or force_editor:
10437                 edittext = []
10438                 if text:
10439                     edittext.append(text)
10440                 edittext.append("")
10441                 edittext.append("") # Empty line between message and comments.
10442                 edittext.append(_("HG: Enter commit message."
10443                                   "  Lines beginning with 'HG:' are removed."))
10444                 edittext.append("HG: --")
10445                 edittext.append("HG: user: %s" % user)
10446                 if p2 != nullid:
10447                     edittext.append("HG: branch merge")
10448                 if branchname:
10449                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
10450                 edittext.extend(["HG: added %s" % f for f in added])
10451                 edittext.extend(["HG: changed %s" % f for f in updated])
10452                 edittext.extend(["HG: removed %s" % f for f in removed])
10453                 if not added and not updated and not removed:
10454                     edittext.append("HG: no files changed")
10455                 edittext.append("")
10456                 # run editor in the repository root
10457 E               olddir = os.getcwd()
10458 >               OSError: [Errno 2] No such file or directory
10459 
10460 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
10461 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
10462 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
10463 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
10464 HG: --
10465 HG: user: nobody
10466 HG: branch 'default'
10467 HG: added ab56b4d92b40713acc5af89985d4b786
10468 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
10469 Vim: Beendet.
10470 ]2;Terminal - Terminal]1;Terminal - Terminal
10471 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
10472 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
10473 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
10474 
10475 transaction abort!
10476 rollback completed
10477 transaction abort!
10478 rollback completed
10479 
10480 - - - - - - - - - - - - -  test_size: recorded stderr - - - - - - - - - - - - - 
10481 transaction abort!
10482 rollback completed
10483 
10484 ________________________________________________________________________________
10485 ______ entrypoint: test_backends_hg.py TestMercurialBackend().test_size_2 ______
10486 
10487     def test_size_2(self):
10488         item = self.backend.create_item('size2')
10489         rev = item.create_revision(0)
10490         rev.write('asdf')
10491         assert rev.size == 4
10492 >       item.commit()
10493 
10494 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:565]
10495 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10496 
10497     def commit(self):
10498         """
10499             @see: Backend._commit_item.__doc__
10500             """
10501         assert self._uncommitted_revision is not None
10502 >       self._backend._commit_item(self._uncommitted_revision)
10503 
10504 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
10505 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10506 
10507     def _commit_item(self, revision, second_parent=None):
10508         """
10509             Commit given Item Revision to repository. Update and commit Item index file.
10510             If Revision already exists, raise RevisionAlreadyExistsError.
10511             """
10512         item = revision.item
10513         lock = self._lock_repo() #XXX: lock item only!
10514         try:
10515             if not item._id:
10516                 self._add_item(item)
10517             elif revision.revno in self._list_revisions(item):
10518                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
10519     
10520             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
10521             if revision.revno > 0:
10522                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
10523                 if second_parent:
10524                     parents.append(second_parent)
10525             else:
10526                 self._open_item_index(item, 'wb').close()
10527                 self._repo.add([item._id, "%s.rev" % item._id])
10528                 parents = []
10529             internal_meta = {'rev': revision.revno,
10530                              'name': item.name,
10531                              'id': item._id,
10532                              'parents': " ".join(parents)}
10533             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
10534             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
10535     
10536             if not revision.timestamp:
10537                 revision.timestamp = long(time.time())
10538             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
10539             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
10540             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
10541             try:
10542                 match = mercurial.match.exact(self._rev_path, '', [item._id])
10543 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
10544 
10545 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
10546 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10547 
10548     def commit(self, files=None, text="", user=None, date=None,
10549                match=None, force=False, force_editor=False,
10550                p1=None, p2=None, extra={}, empty_ok=False):
10551         wlock = lock = None
10552         if extra.get("close"):
10553             force = True
10554         if files:
10555             files = util.unique(files)
10556         try:
10557             wlock = self.wlock()
10558             lock = self.lock()
10559             use_dirstate = (p1 is None) # not rawcommit
10560     
10561             if use_dirstate:
10562                 p1, p2 = self.dirstate.parents()
10563                 update_dirstate = True
10564     
10565                 if (not force and p2 != nullid and
10566                     (match and (match.files() or match.anypats()))):
10567                     raise util.Abort(_('cannot partially commit a merge '
10568                                        '(do not specify files or patterns)'))
10569     
10570                 if files:
10571                     modified, removed = [], []
10572                     for f in files:
10573                         s = self.dirstate[f]
10574                         if s in 'nma':
10575                             modified.append(f)
10576                         elif s == 'r':
10577                             removed.append(f)
10578                         else:
10579                             self.ui.warn(_("%s not tracked!\n") % f)
10580                     changes = [modified, [], removed, [], []]
10581                 else:
10582                     changes = self.status(match=match)
10583             else:
10584                 p1, p2 = p1, p2 or nullid
10585                 update_dirstate = (self.dirstate.parents()[0] == p1)
10586                 changes = [files, [], [], [], []]
10587     
10588             ms = merge_.mergestate(self)
10589             for f in changes[0]:
10590                 if f in ms and ms[f] == 'u':
10591                     raise util.Abort(_("unresolved merge conflicts "
10592                                                     "(see hg resolve)"))
10593             wctx = context.workingctx(self, (p1, p2), text, user, date,
10594                                       extra, changes)
10595             r = self._commitctx(wctx, force, force_editor, empty_ok,
10596 >                               use_dirstate, update_dirstate)
10597 
10598 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
10599 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10600 
10601     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
10602                   use_dirstate=True, update_dirstate=True):
10603         tr = None
10604         valid = 0 # don't save the dirstate if this isn't set
10605         try:
10606             commit = util.sort(wctx.modified() + wctx.added())
10607             remove = wctx.removed()
10608             extra = wctx.extra().copy()
10609             branchname = extra['branch']
10610             user = wctx.user()
10611             text = wctx.description()
10612     
10613             p1, p2 = [p.node() for p in wctx.parents()]
10614             c1 = self.changelog.read(p1)
10615             c2 = self.changelog.read(p2)
10616             m1 = self.manifest.read(c1[0]).copy()
10617             m2 = self.manifest.read(c2[0])
10618     
10619             if use_dirstate:
10620                 oldname = c1[5].get("branch") # stored in UTF-8
10621                 if (not commit and not remove and not force and p2 == nullid
10622                     and branchname == oldname):
10623                     self.ui.status(_("nothing changed\n"))
10624                     return None
10625     
10626             xp1 = hex(p1)
10627             if p2 == nullid: xp2 = ''
10628             else: xp2 = hex(p2)
10629     
10630             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
10631     
10632             tr = self.transaction()
10633             trp = weakref.proxy(tr)
10634     
10635             # check in files
10636             new = {}
10637             changed = []
10638             linkrev = len(self)
10639             for f in commit:
10640                 self.ui.note(f + "\n")
10641                 try:
10642                     fctx = wctx.filectx(f)
10643                     newflags = fctx.flags()
10644                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
10645                     if ((not changed or changed[-1] != f) and
10646                         m2.get(f) != new[f]):
10647                         # mention the file in the changelog if some
10648                         # flag changed, even if there was no content
10649                         # change.
10650                         if m1.flags(f) != newflags:
10651                             changed.append(f)
10652                     m1.set(f, newflags)
10653                     if use_dirstate:
10654                         self.dirstate.normal(f)
10655     
10656                 except (OSError, IOError):
10657                     if use_dirstate:
10658                         self.ui.warn(_("trouble committing %s!\n") % f)
10659                         raise
10660                     else:
10661                         remove.append(f)
10662     
10663             updated, added = [], []
10664             for f in util.sort(changed):
10665                 if f in m1 or f in m2:
10666                     updated.append(f)
10667                 else:
10668                     added.append(f)
10669     
10670             # update manifest
10671             m1.update(new)
10672             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
10673             removed1 = []
10674     
10675             for f in removed:
10676                 if f in m1:
10677                     del m1[f]
10678                     removed1.append(f)
10679             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
10680                                    (new, removed1))
10681     
10682             # add changeset
10683             if (not empty_ok and not text) or force_editor:
10684                 edittext = []
10685                 if text:
10686                     edittext.append(text)
10687                 edittext.append("")
10688                 edittext.append("") # Empty line between message and comments.
10689                 edittext.append(_("HG: Enter commit message."
10690                                   "  Lines beginning with 'HG:' are removed."))
10691                 edittext.append("HG: --")
10692                 edittext.append("HG: user: %s" % user)
10693                 if p2 != nullid:
10694                     edittext.append("HG: branch merge")
10695                 if branchname:
10696                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
10697                 edittext.extend(["HG: added %s" % f for f in added])
10698                 edittext.extend(["HG: changed %s" % f for f in updated])
10699                 edittext.extend(["HG: removed %s" % f for f in removed])
10700                 if not added and not updated and not removed:
10701                     edittext.append("HG: no files changed")
10702                 edittext.append("")
10703                 # run editor in the repository root
10704 E               olddir = os.getcwd()
10705 >               OSError: [Errno 2] No such file or directory
10706 
10707 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
10708 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
10709 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
10710 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
10711 HG: --
10712 HG: user: nobody
10713 HG: branch 'default'
10714 HG: added ab56b4d92b40713acc5af89985d4b786
10715 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
10716 Vim: Beendet.
10717 ]2;Terminal - Terminal]1;Terminal - Terminal
10718 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
10719 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
10720 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
10721 
10722 transaction abort!
10723 rollback completed
10724 transaction abort!
10725 rollback completed
10726 
10727 - - - - - - - - - - - -  test_size_2: recorded stderr - - - - - - - - - - - - -
10728 transaction abort!
10729 rollback completed
10730 
10731 ________________________________________________________________________________
10732  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[0] 
10733 
10734     def test_value(value, revno):
10735         item = self.backend.create_item('valid_values_%s' % revno)
10736         rev = item.create_revision(0)
10737         rev["key"] = value
10738 >       item.commit()
10739 
10740 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
10741 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10742 
10743     def commit(self):
10744         """
10745             @see: Backend._commit_item.__doc__
10746             """
10747         assert self._uncommitted_revision is not None
10748 >       self._backend._commit_item(self._uncommitted_revision)
10749 
10750 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
10751 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10752 
10753     def _commit_item(self, revision, second_parent=None):
10754         """
10755             Commit given Item Revision to repository. Update and commit Item index file.
10756             If Revision already exists, raise RevisionAlreadyExistsError.
10757             """
10758         item = revision.item
10759         lock = self._lock_repo() #XXX: lock item only!
10760         try:
10761             if not item._id:
10762                 self._add_item(item)
10763             elif revision.revno in self._list_revisions(item):
10764                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
10765     
10766             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
10767             if revision.revno > 0:
10768                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
10769                 if second_parent:
10770                     parents.append(second_parent)
10771             else:
10772                 self._open_item_index(item, 'wb').close()
10773                 self._repo.add([item._id, "%s.rev" % item._id])
10774                 parents = []
10775             internal_meta = {'rev': revision.revno,
10776                              'name': item.name,
10777                              'id': item._id,
10778                              'parents': " ".join(parents)}
10779             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
10780             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
10781     
10782             if not revision.timestamp:
10783                 revision.timestamp = long(time.time())
10784             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
10785             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
10786             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
10787             try:
10788                 match = mercurial.match.exact(self._rev_path, '', [item._id])
10789 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
10790 
10791 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
10792 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10793 
10794     def commit(self, files=None, text="", user=None, date=None,
10795                match=None, force=False, force_editor=False,
10796                p1=None, p2=None, extra={}, empty_ok=False):
10797         wlock = lock = None
10798         if extra.get("close"):
10799             force = True
10800         if files:
10801             files = util.unique(files)
10802         try:
10803             wlock = self.wlock()
10804             lock = self.lock()
10805             use_dirstate = (p1 is None) # not rawcommit
10806     
10807             if use_dirstate:
10808                 p1, p2 = self.dirstate.parents()
10809                 update_dirstate = True
10810     
10811                 if (not force and p2 != nullid and
10812                     (match and (match.files() or match.anypats()))):
10813                     raise util.Abort(_('cannot partially commit a merge '
10814                                        '(do not specify files or patterns)'))
10815     
10816                 if files:
10817                     modified, removed = [], []
10818                     for f in files:
10819                         s = self.dirstate[f]
10820                         if s in 'nma':
10821                             modified.append(f)
10822                         elif s == 'r':
10823                             removed.append(f)
10824                         else:
10825                             self.ui.warn(_("%s not tracked!\n") % f)
10826                     changes = [modified, [], removed, [], []]
10827                 else:
10828                     changes = self.status(match=match)
10829             else:
10830                 p1, p2 = p1, p2 or nullid
10831                 update_dirstate = (self.dirstate.parents()[0] == p1)
10832                 changes = [files, [], [], [], []]
10833     
10834             ms = merge_.mergestate(self)
10835             for f in changes[0]:
10836                 if f in ms and ms[f] == 'u':
10837                     raise util.Abort(_("unresolved merge conflicts "
10838                                                     "(see hg resolve)"))
10839             wctx = context.workingctx(self, (p1, p2), text, user, date,
10840                                       extra, changes)
10841             r = self._commitctx(wctx, force, force_editor, empty_ok,
10842 >                               use_dirstate, update_dirstate)
10843 
10844 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
10845 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10846 
10847     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
10848                   use_dirstate=True, update_dirstate=True):
10849         tr = None
10850         valid = 0 # don't save the dirstate if this isn't set
10851         try:
10852             commit = util.sort(wctx.modified() + wctx.added())
10853             remove = wctx.removed()
10854             extra = wctx.extra().copy()
10855             branchname = extra['branch']
10856             user = wctx.user()
10857             text = wctx.description()
10858     
10859             p1, p2 = [p.node() for p in wctx.parents()]
10860             c1 = self.changelog.read(p1)
10861             c2 = self.changelog.read(p2)
10862             m1 = self.manifest.read(c1[0]).copy()
10863             m2 = self.manifest.read(c2[0])
10864     
10865             if use_dirstate:
10866                 oldname = c1[5].get("branch") # stored in UTF-8
10867                 if (not commit and not remove and not force and p2 == nullid
10868                     and branchname == oldname):
10869                     self.ui.status(_("nothing changed\n"))
10870                     return None
10871     
10872             xp1 = hex(p1)
10873             if p2 == nullid: xp2 = ''
10874             else: xp2 = hex(p2)
10875     
10876             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
10877     
10878             tr = self.transaction()
10879             trp = weakref.proxy(tr)
10880     
10881             # check in files
10882             new = {}
10883             changed = []
10884             linkrev = len(self)
10885             for f in commit:
10886                 self.ui.note(f + "\n")
10887                 try:
10888                     fctx = wctx.filectx(f)
10889                     newflags = fctx.flags()
10890                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
10891                     if ((not changed or changed[-1] != f) and
10892                         m2.get(f) != new[f]):
10893                         # mention the file in the changelog if some
10894                         # flag changed, even if there was no content
10895                         # change.
10896                         if m1.flags(f) != newflags:
10897                             changed.append(f)
10898                     m1.set(f, newflags)
10899                     if use_dirstate:
10900                         self.dirstate.normal(f)
10901     
10902                 except (OSError, IOError):
10903                     if use_dirstate:
10904                         self.ui.warn(_("trouble committing %s!\n") % f)
10905                         raise
10906                     else:
10907                         remove.append(f)
10908     
10909             updated, added = [], []
10910             for f in util.sort(changed):
10911                 if f in m1 or f in m2:
10912                     updated.append(f)
10913                 else:
10914                     added.append(f)
10915     
10916             # update manifest
10917             m1.update(new)
10918             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
10919             removed1 = []
10920     
10921             for f in removed:
10922                 if f in m1:
10923                     del m1[f]
10924                     removed1.append(f)
10925             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
10926                                    (new, removed1))
10927     
10928             # add changeset
10929             if (not empty_ok and not text) or force_editor:
10930                 edittext = []
10931                 if text:
10932                     edittext.append(text)
10933                 edittext.append("")
10934                 edittext.append("") # Empty line between message and comments.
10935                 edittext.append(_("HG: Enter commit message."
10936                                   "  Lines beginning with 'HG:' are removed."))
10937                 edittext.append("HG: --")
10938                 edittext.append("HG: user: %s" % user)
10939                 if p2 != nullid:
10940                     edittext.append("HG: branch merge")
10941                 if branchname:
10942                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
10943                 edittext.extend(["HG: added %s" % f for f in added])
10944                 edittext.extend(["HG: changed %s" % f for f in updated])
10945                 edittext.extend(["HG: removed %s" % f for f in removed])
10946                 if not added and not updated and not removed:
10947                     edittext.append("HG: no files changed")
10948                 edittext.append("")
10949                 # run editor in the repository root
10950 E               olddir = os.getcwd()
10951 >               OSError: [Errno 2] No such file or directory
10952 
10953 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
10954 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
10955 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
10956 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
10957 HG: --
10958 HG: user: nobody
10959 HG: branch 'default'
10960 HG: added ab56b4d92b40713acc5af89985d4b786
10961 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
10962 Vim: Beendet.
10963 ]2;Terminal - Terminal]1;Terminal - Terminal
10964 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
10965 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
10966 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
10967 
10968 transaction abort!
10969 rollback completed
10970 transaction abort!
10971 rollback completed
10972 
10973 - - - - - - - - - - - - - -  [0]: recorded stderr - - - - - - - - - - - - - - -
10974 transaction abort!
10975 rollback completed
10976 
10977 ________________________________________________________________________________
10978  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[1] 
10979 
10980     def test_value(value, revno):
10981         item = self.backend.create_item('valid_values_%s' % revno)
10982         rev = item.create_revision(0)
10983         rev["key"] = value
10984 >       item.commit()
10985 
10986 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
10987 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10988 
10989     def commit(self):
10990         """
10991             @see: Backend._commit_item.__doc__
10992             """
10993         assert self._uncommitted_revision is not None
10994 >       self._backend._commit_item(self._uncommitted_revision)
10995 
10996 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
10997 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10998 
10999     def _commit_item(self, revision, second_parent=None):
11000         """
11001             Commit given Item Revision to repository. Update and commit Item index file.
11002             If Revision already exists, raise RevisionAlreadyExistsError.
11003             """
11004         item = revision.item
11005         lock = self._lock_repo() #XXX: lock item only!
11006         try:
11007             if not item._id:
11008                 self._add_item(item)
11009             elif revision.revno in self._list_revisions(item):
11010                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
11011     
11012             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
11013             if revision.revno > 0:
11014                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
11015                 if second_parent:
11016                     parents.append(second_parent)
11017             else:
11018                 self._open_item_index(item, 'wb').close()
11019                 self._repo.add([item._id, "%s.rev" % item._id])
11020                 parents = []
11021             internal_meta = {'rev': revision.revno,
11022                              'name': item.name,
11023                              'id': item._id,
11024                              'parents': " ".join(parents)}
11025             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
11026             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
11027     
11028             if not revision.timestamp:
11029                 revision.timestamp = long(time.time())
11030             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
11031             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
11032             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
11033             try:
11034                 match = mercurial.match.exact(self._rev_path, '', [item._id])
11035 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
11036 
11037 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
11038 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11039 
11040     def commit(self, files=None, text="", user=None, date=None,
11041                match=None, force=False, force_editor=False,
11042                p1=None, p2=None, extra={}, empty_ok=False):
11043         wlock = lock = None
11044         if extra.get("close"):
11045             force = True
11046         if files:
11047             files = util.unique(files)
11048         try:
11049             wlock = self.wlock()
11050             lock = self.lock()
11051             use_dirstate = (p1 is None) # not rawcommit
11052     
11053             if use_dirstate:
11054                 p1, p2 = self.dirstate.parents()
11055                 update_dirstate = True
11056     
11057                 if (not force and p2 != nullid and
11058                     (match and (match.files() or match.anypats()))):
11059                     raise util.Abort(_('cannot partially commit a merge '
11060                                        '(do not specify files or patterns)'))
11061     
11062                 if files:
11063                     modified, removed = [], []
11064                     for f in files:
11065                         s = self.dirstate[f]
11066                         if s in 'nma':
11067                             modified.append(f)
11068                         elif s == 'r':
11069                             removed.append(f)
11070                         else:
11071                             self.ui.warn(_("%s not tracked!\n") % f)
11072                     changes = [modified, [], removed, [], []]
11073                 else:
11074                     changes = self.status(match=match)
11075             else:
11076                 p1, p2 = p1, p2 or nullid
11077                 update_dirstate = (self.dirstate.parents()[0] == p1)
11078                 changes = [files, [], [], [], []]
11079     
11080             ms = merge_.mergestate(self)
11081             for f in changes[0]:
11082                 if f in ms and ms[f] == 'u':
11083                     raise util.Abort(_("unresolved merge conflicts "
11084                                                     "(see hg resolve)"))
11085             wctx = context.workingctx(self, (p1, p2), text, user, date,
11086                                       extra, changes)
11087             r = self._commitctx(wctx, force, force_editor, empty_ok,
11088 >                               use_dirstate, update_dirstate)
11089 
11090 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
11091 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11092 
11093     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
11094                   use_dirstate=True, update_dirstate=True):
11095         tr = None
11096         valid = 0 # don't save the dirstate if this isn't set
11097         try:
11098             commit = util.sort(wctx.modified() + wctx.added())
11099             remove = wctx.removed()
11100             extra = wctx.extra().copy()
11101             branchname = extra['branch']
11102             user = wctx.user()
11103             text = wctx.description()
11104     
11105             p1, p2 = [p.node() for p in wctx.parents()]
11106             c1 = self.changelog.read(p1)
11107             c2 = self.changelog.read(p2)
11108             m1 = self.manifest.read(c1[0]).copy()
11109             m2 = self.manifest.read(c2[0])
11110     
11111             if use_dirstate:
11112                 oldname = c1[5].get("branch") # stored in UTF-8
11113                 if (not commit and not remove and not force and p2 == nullid
11114                     and branchname == oldname):
11115                     self.ui.status(_("nothing changed\n"))
11116                     return None
11117     
11118             xp1 = hex(p1)
11119             if p2 == nullid: xp2 = ''
11120             else: xp2 = hex(p2)
11121     
11122             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
11123     
11124             tr = self.transaction()
11125             trp = weakref.proxy(tr)
11126     
11127             # check in files
11128             new = {}
11129             changed = []
11130             linkrev = len(self)
11131             for f in commit:
11132                 self.ui.note(f + "\n")
11133                 try:
11134                     fctx = wctx.filectx(f)
11135                     newflags = fctx.flags()
11136                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
11137                     if ((not changed or changed[-1] != f) and
11138                         m2.get(f) != new[f]):
11139                         # mention the file in the changelog if some
11140                         # flag changed, even if there was no content
11141                         # change.
11142                         if m1.flags(f) != newflags:
11143                             changed.append(f)
11144                     m1.set(f, newflags)
11145                     if use_dirstate:
11146                         self.dirstate.normal(f)
11147     
11148                 except (OSError, IOError):
11149                     if use_dirstate:
11150                         self.ui.warn(_("trouble committing %s!\n") % f)
11151                         raise
11152                     else:
11153                         remove.append(f)
11154     
11155             updated, added = [], []
11156             for f in util.sort(changed):
11157                 if f in m1 or f in m2:
11158                     updated.append(f)
11159                 else:
11160                     added.append(f)
11161     
11162             # update manifest
11163             m1.update(new)
11164             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
11165             removed1 = []
11166     
11167             for f in removed:
11168                 if f in m1:
11169                     del m1[f]
11170                     removed1.append(f)
11171             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
11172                                    (new, removed1))
11173     
11174             # add changeset
11175             if (not empty_ok and not text) or force_editor:
11176                 edittext = []
11177                 if text:
11178                     edittext.append(text)
11179                 edittext.append("")
11180                 edittext.append("") # Empty line between message and comments.
11181                 edittext.append(_("HG: Enter commit message."
11182                                   "  Lines beginning with 'HG:' are removed."))
11183                 edittext.append("HG: --")
11184                 edittext.append("HG: user: %s" % user)
11185                 if p2 != nullid:
11186                     edittext.append("HG: branch merge")
11187                 if branchname:
11188                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
11189                 edittext.extend(["HG: added %s" % f for f in added])
11190                 edittext.extend(["HG: changed %s" % f for f in updated])
11191                 edittext.extend(["HG: removed %s" % f for f in removed])
11192                 if not added and not updated and not removed:
11193                     edittext.append("HG: no files changed")
11194                 edittext.append("")
11195                 # run editor in the repository root
11196 E               olddir = os.getcwd()
11197 >               OSError: [Errno 2] No such file or directory
11198 
11199 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
11200 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
11201 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
11202 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
11203 HG: --
11204 HG: user: nobody
11205 HG: branch 'default'
11206 HG: added ab56b4d92b40713acc5af89985d4b786
11207 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
11208 Vim: Beendet.
11209 ]2;Terminal - Terminal]1;Terminal - Terminal
11210 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
11211 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
11212 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
11213 
11214 transaction abort!
11215 rollback completed
11216 transaction abort!
11217 rollback completed
11218 
11219 - - - - - - - - - - - - - -  [1]: recorded stderr - - - - - - - - - - - - - - -
11220 transaction abort!
11221 rollback completed
11222 
11223 ________________________________________________________________________________
11224  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[2] 
11225 
11226     def test_value(value, revno):
11227         item = self.backend.create_item('valid_values_%s' % revno)
11228         rev = item.create_revision(0)
11229         rev["key"] = value
11230 >       item.commit()
11231 
11232 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
11233 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11234 
11235     def commit(self):
11236         """
11237             @see: Backend._commit_item.__doc__
11238             """
11239         assert self._uncommitted_revision is not None
11240 >       self._backend._commit_item(self._uncommitted_revision)
11241 
11242 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
11243 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11244 
11245     def _commit_item(self, revision, second_parent=None):
11246         """
11247             Commit given Item Revision to repository. Update and commit Item index file.
11248             If Revision already exists, raise RevisionAlreadyExistsError.
11249             """
11250         item = revision.item
11251         lock = self._lock_repo() #XXX: lock item only!
11252         try:
11253             if not item._id:
11254                 self._add_item(item)
11255             elif revision.revno in self._list_revisions(item):
11256                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
11257     
11258             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
11259             if revision.revno > 0:
11260                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
11261                 if second_parent:
11262                     parents.append(second_parent)
11263             else:
11264                 self._open_item_index(item, 'wb').close()
11265                 self._repo.add([item._id, "%s.rev" % item._id])
11266                 parents = []
11267             internal_meta = {'rev': revision.revno,
11268                              'name': item.name,
11269                              'id': item._id,
11270                              'parents': " ".join(parents)}
11271             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
11272             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
11273     
11274             if not revision.timestamp:
11275                 revision.timestamp = long(time.time())
11276             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
11277             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
11278             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
11279             try:
11280                 match = mercurial.match.exact(self._rev_path, '', [item._id])
11281 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
11282 
11283 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
11284 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11285 
11286     def commit(self, files=None, text="", user=None, date=None,
11287                match=None, force=False, force_editor=False,
11288                p1=None, p2=None, extra={}, empty_ok=False):
11289         wlock = lock = None
11290         if extra.get("close"):
11291             force = True
11292         if files:
11293             files = util.unique(files)
11294         try:
11295             wlock = self.wlock()
11296             lock = self.lock()
11297             use_dirstate = (p1 is None) # not rawcommit
11298     
11299             if use_dirstate:
11300                 p1, p2 = self.dirstate.parents()
11301                 update_dirstate = True
11302     
11303                 if (not force and p2 != nullid and
11304                     (match and (match.files() or match.anypats()))):
11305                     raise util.Abort(_('cannot partially commit a merge '
11306                                        '(do not specify files or patterns)'))
11307     
11308                 if files:
11309                     modified, removed = [], []
11310                     for f in files:
11311                         s = self.dirstate[f]
11312                         if s in 'nma':
11313                             modified.append(f)
11314                         elif s == 'r':
11315                             removed.append(f)
11316                         else:
11317                             self.ui.warn(_("%s not tracked!\n") % f)
11318                     changes = [modified, [], removed, [], []]
11319                 else:
11320                     changes = self.status(match=match)
11321             else:
11322                 p1, p2 = p1, p2 or nullid
11323                 update_dirstate = (self.dirstate.parents()[0] == p1)
11324                 changes = [files, [], [], [], []]
11325     
11326             ms = merge_.mergestate(self)
11327             for f in changes[0]:
11328                 if f in ms and ms[f] == 'u':
11329                     raise util.Abort(_("unresolved merge conflicts "
11330                                                     "(see hg resolve)"))
11331             wctx = context.workingctx(self, (p1, p2), text, user, date,
11332                                       extra, changes)
11333             r = self._commitctx(wctx, force, force_editor, empty_ok,
11334 >                               use_dirstate, update_dirstate)
11335 
11336 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
11337 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11338 
11339     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
11340                   use_dirstate=True, update_dirstate=True):
11341         tr = None
11342         valid = 0 # don't save the dirstate if this isn't set
11343         try:
11344             commit = util.sort(wctx.modified() + wctx.added())
11345             remove = wctx.removed()
11346             extra = wctx.extra().copy()
11347             branchname = extra['branch']
11348             user = wctx.user()
11349             text = wctx.description()
11350     
11351             p1, p2 = [p.node() for p in wctx.parents()]
11352             c1 = self.changelog.read(p1)
11353             c2 = self.changelog.read(p2)
11354             m1 = self.manifest.read(c1[0]).copy()
11355             m2 = self.manifest.read(c2[0])
11356     
11357             if use_dirstate:
11358                 oldname = c1[5].get("branch") # stored in UTF-8
11359                 if (not commit and not remove and not force and p2 == nullid
11360                     and branchname == oldname):
11361                     self.ui.status(_("nothing changed\n"))
11362                     return None
11363     
11364             xp1 = hex(p1)
11365             if p2 == nullid: xp2 = ''
11366             else: xp2 = hex(p2)
11367     
11368             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
11369     
11370             tr = self.transaction()
11371             trp = weakref.proxy(tr)
11372     
11373             # check in files
11374             new = {}
11375             changed = []
11376             linkrev = len(self)
11377             for f in commit:
11378                 self.ui.note(f + "\n")
11379                 try:
11380                     fctx = wctx.filectx(f)
11381                     newflags = fctx.flags()
11382                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
11383                     if ((not changed or changed[-1] != f) and
11384                         m2.get(f) != new[f]):
11385                         # mention the file in the changelog if some
11386                         # flag changed, even if there was no content
11387                         # change.
11388                         if m1.flags(f) != newflags:
11389                             changed.append(f)
11390                     m1.set(f, newflags)
11391                     if use_dirstate:
11392                         self.dirstate.normal(f)
11393     
11394                 except (OSError, IOError):
11395                     if use_dirstate:
11396                         self.ui.warn(_("trouble committing %s!\n") % f)
11397                         raise
11398                     else:
11399                         remove.append(f)
11400     
11401             updated, added = [], []
11402             for f in util.sort(changed):
11403                 if f in m1 or f in m2:
11404                     updated.append(f)
11405                 else:
11406                     added.append(f)
11407     
11408             # update manifest
11409             m1.update(new)
11410             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
11411             removed1 = []
11412     
11413             for f in removed:
11414                 if f in m1:
11415                     del m1[f]
11416                     removed1.append(f)
11417             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
11418                                    (new, removed1))
11419     
11420             # add changeset
11421             if (not empty_ok and not text) or force_editor:
11422                 edittext = []
11423                 if text:
11424                     edittext.append(text)
11425                 edittext.append("")
11426                 edittext.append("") # Empty line between message and comments.
11427                 edittext.append(_("HG: Enter commit message."
11428                                   "  Lines beginning with 'HG:' are removed."))
11429                 edittext.append("HG: --")
11430                 edittext.append("HG: user: %s" % user)
11431                 if p2 != nullid:
11432                     edittext.append("HG: branch merge")
11433                 if branchname:
11434                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
11435                 edittext.extend(["HG: added %s" % f for f in added])
11436                 edittext.extend(["HG: changed %s" % f for f in updated])
11437                 edittext.extend(["HG: removed %s" % f for f in removed])
11438                 if not added and not updated and not removed:
11439                     edittext.append("HG: no files changed")
11440                 edittext.append("")
11441                 # run editor in the repository root
11442 E               olddir = os.getcwd()
11443 >               OSError: [Errno 2] No such file or directory
11444 
11445 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
11446 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
11447 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
11448 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
11449 HG: --
11450 HG: user: nobody
11451 HG: branch 'default'
11452 HG: added ab56b4d92b40713acc5af89985d4b786
11453 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
11454 Vim: Beendet.
11455 ]2;Terminal - Terminal]1;Terminal - Terminal
11456 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
11457 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
11458 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
11459 
11460 transaction abort!
11461 rollback completed
11462 transaction abort!
11463 rollback completed
11464 
11465 - - - - - - - - - - - - - -  [2]: recorded stderr - - - - - - - - - - - - - - -
11466 transaction abort!
11467 rollback completed
11468 
11469 ________________________________________________________________________________
11470  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[3] 
11471 
11472     def test_value(value, revno):
11473         item = self.backend.create_item('valid_values_%s' % revno)
11474         rev = item.create_revision(0)
11475         rev["key"] = value
11476 >       item.commit()
11477 
11478 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
11479 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11480 
11481     def commit(self):
11482         """
11483             @see: Backend._commit_item.__doc__
11484             """
11485         assert self._uncommitted_revision is not None
11486 >       self._backend._commit_item(self._uncommitted_revision)
11487 
11488 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
11489 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11490 
11491     def _commit_item(self, revision, second_parent=None):
11492         """
11493             Commit given Item Revision to repository. Update and commit Item index file.
11494             If Revision already exists, raise RevisionAlreadyExistsError.
11495             """
11496         item = revision.item
11497         lock = self._lock_repo() #XXX: lock item only!
11498         try:
11499             if not item._id:
11500                 self._add_item(item)
11501             elif revision.revno in self._list_revisions(item):
11502                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
11503     
11504             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
11505             if revision.revno > 0:
11506                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
11507                 if second_parent:
11508                     parents.append(second_parent)
11509             else:
11510                 self._open_item_index(item, 'wb').close()
11511                 self._repo.add([item._id, "%s.rev" % item._id])
11512                 parents = []
11513             internal_meta = {'rev': revision.revno,
11514                              'name': item.name,
11515                              'id': item._id,
11516                              'parents': " ".join(parents)}
11517             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
11518             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
11519     
11520             if not revision.timestamp:
11521                 revision.timestamp = long(time.time())
11522             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
11523             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
11524             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
11525             try:
11526                 match = mercurial.match.exact(self._rev_path, '', [item._id])
11527 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
11528 
11529 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
11530 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11531 
11532     def commit(self, files=None, text="", user=None, date=None,
11533                match=None, force=False, force_editor=False,
11534                p1=None, p2=None, extra={}, empty_ok=False):
11535         wlock = lock = None
11536         if extra.get("close"):
11537             force = True
11538         if files:
11539             files = util.unique(files)
11540         try:
11541             wlock = self.wlock()
11542             lock = self.lock()
11543             use_dirstate = (p1 is None) # not rawcommit
11544     
11545             if use_dirstate:
11546                 p1, p2 = self.dirstate.parents()
11547                 update_dirstate = True
11548     
11549                 if (not force and p2 != nullid and
11550                     (match and (match.files() or match.anypats()))):
11551                     raise util.Abort(_('cannot partially commit a merge '
11552                                        '(do not specify files or patterns)'))
11553     
11554                 if files:
11555                     modified, removed = [], []
11556                     for f in files:
11557                         s = self.dirstate[f]
11558                         if s in 'nma':
11559                             modified.append(f)
11560                         elif s == 'r':
11561                             removed.append(f)
11562                         else:
11563                             self.ui.warn(_("%s not tracked!\n") % f)
11564                     changes = [modified, [], removed, [], []]
11565                 else:
11566                     changes = self.status(match=match)
11567             else:
11568                 p1, p2 = p1, p2 or nullid
11569                 update_dirstate = (self.dirstate.parents()[0] == p1)
11570                 changes = [files, [], [], [], []]
11571     
11572             ms = merge_.mergestate(self)
11573             for f in changes[0]:
11574                 if f in ms and ms[f] == 'u':
11575                     raise util.Abort(_("unresolved merge conflicts "
11576                                                     "(see hg resolve)"))
11577             wctx = context.workingctx(self, (p1, p2), text, user, date,
11578                                       extra, changes)
11579             r = self._commitctx(wctx, force, force_editor, empty_ok,
11580 >                               use_dirstate, update_dirstate)
11581 
11582 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
11583 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11584 
11585     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
11586                   use_dirstate=True, update_dirstate=True):
11587         tr = None
11588         valid = 0 # don't save the dirstate if this isn't set
11589         try:
11590             commit = util.sort(wctx.modified() + wctx.added())
11591             remove = wctx.removed()
11592             extra = wctx.extra().copy()
11593             branchname = extra['branch']
11594             user = wctx.user()
11595             text = wctx.description()
11596     
11597             p1, p2 = [p.node() for p in wctx.parents()]
11598             c1 = self.changelog.read(p1)
11599             c2 = self.changelog.read(p2)
11600             m1 = self.manifest.read(c1[0]).copy()
11601             m2 = self.manifest.read(c2[0])
11602     
11603             if use_dirstate:
11604                 oldname = c1[5].get("branch") # stored in UTF-8
11605                 if (not commit and not remove and not force and p2 == nullid
11606                     and branchname == oldname):
11607                     self.ui.status(_("nothing changed\n"))
11608                     return None
11609     
11610             xp1 = hex(p1)
11611             if p2 == nullid: xp2 = ''
11612             else: xp2 = hex(p2)
11613     
11614             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
11615     
11616             tr = self.transaction()
11617             trp = weakref.proxy(tr)
11618     
11619             # check in files
11620             new = {}
11621             changed = []
11622             linkrev = len(self)
11623             for f in commit:
11624                 self.ui.note(f + "\n")
11625                 try:
11626                     fctx = wctx.filectx(f)
11627                     newflags = fctx.flags()
11628                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
11629                     if ((not changed or changed[-1] != f) and
11630                         m2.get(f) != new[f]):
11631                         # mention the file in the changelog if some
11632                         # flag changed, even if there was no content
11633                         # change.
11634                         if m1.flags(f) != newflags:
11635                             changed.append(f)
11636                     m1.set(f, newflags)
11637                     if use_dirstate:
11638                         self.dirstate.normal(f)
11639     
11640                 except (OSError, IOError):
11641                     if use_dirstate:
11642                         self.ui.warn(_("trouble committing %s!\n") % f)
11643                         raise
11644                     else:
11645                         remove.append(f)
11646     
11647             updated, added = [], []
11648             for f in util.sort(changed):
11649                 if f in m1 or f in m2:
11650                     updated.append(f)
11651                 else:
11652                     added.append(f)
11653     
11654             # update manifest
11655             m1.update(new)
11656             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
11657             removed1 = []
11658     
11659             for f in removed:
11660                 if f in m1:
11661                     del m1[f]
11662                     removed1.append(f)
11663             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
11664                                    (new, removed1))
11665     
11666             # add changeset
11667             if (not empty_ok and not text) or force_editor:
11668                 edittext = []
11669                 if text:
11670                     edittext.append(text)
11671                 edittext.append("")
11672                 edittext.append("") # Empty line between message and comments.
11673                 edittext.append(_("HG: Enter commit message."
11674                                   "  Lines beginning with 'HG:' are removed."))
11675                 edittext.append("HG: --")
11676                 edittext.append("HG: user: %s" % user)
11677                 if p2 != nullid:
11678                     edittext.append("HG: branch merge")
11679                 if branchname:
11680                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
11681                 edittext.extend(["HG: added %s" % f for f in added])
11682                 edittext.extend(["HG: changed %s" % f for f in updated])
11683                 edittext.extend(["HG: removed %s" % f for f in removed])
11684                 if not added and not updated and not removed:
11685                     edittext.append("HG: no files changed")
11686                 edittext.append("")
11687                 # run editor in the repository root
11688 E               olddir = os.getcwd()
11689 >               OSError: [Errno 2] No such file or directory
11690 
11691 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
11692 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
11693 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
11694 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
11695 HG: --
11696 HG: user: nobody
11697 HG: branch 'default'
11698 HG: added ab56b4d92b40713acc5af89985d4b786
11699 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
11700 Vim: Beendet.
11701 ]2;Terminal - Terminal]1;Terminal - Terminal
11702 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
11703 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
11704 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
11705 
11706 transaction abort!
11707 rollback completed
11708 transaction abort!
11709 rollback completed
11710 
11711 - - - - - - - - - - - - - -  [3]: recorded stderr - - - - - - - - - - - - - - -
11712 transaction abort!
11713 rollback completed
11714 
11715 ________________________________________________________________________________
11716  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[4] 
11717 
11718     def test_value(value, revno):
11719         item = self.backend.create_item('valid_values_%s' % revno)
11720         rev = item.create_revision(0)
11721         rev["key"] = value
11722 >       item.commit()
11723 
11724 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
11725 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11726 
11727     def commit(self):
11728         """
11729             @see: Backend._commit_item.__doc__
11730             """
11731         assert self._uncommitted_revision is not None
11732 >       self._backend._commit_item(self._uncommitted_revision)
11733 
11734 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
11735 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11736 
11737     def _commit_item(self, revision, second_parent=None):
11738         """
11739             Commit given Item Revision to repository. Update and commit Item index file.
11740             If Revision already exists, raise RevisionAlreadyExistsError.
11741             """
11742         item = revision.item
11743         lock = self._lock_repo() #XXX: lock item only!
11744         try:
11745             if not item._id:
11746                 self._add_item(item)
11747             elif revision.revno in self._list_revisions(item):
11748                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
11749     
11750             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
11751             if revision.revno > 0:
11752                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
11753                 if second_parent:
11754                     parents.append(second_parent)
11755             else:
11756                 self._open_item_index(item, 'wb').close()
11757                 self._repo.add([item._id, "%s.rev" % item._id])
11758                 parents = []
11759             internal_meta = {'rev': revision.revno,
11760                              'name': item.name,
11761                              'id': item._id,
11762                              'parents': " ".join(parents)}
11763             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
11764             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
11765     
11766             if not revision.timestamp:
11767                 revision.timestamp = long(time.time())
11768             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
11769             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
11770             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
11771             try:
11772                 match = mercurial.match.exact(self._rev_path, '', [item._id])
11773 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
11774 
11775 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
11776 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11777 
11778     def commit(self, files=None, text="", user=None, date=None,
11779                match=None, force=False, force_editor=False,
11780                p1=None, p2=None, extra={}, empty_ok=False):
11781         wlock = lock = None
11782         if extra.get("close"):
11783             force = True
11784         if files:
11785             files = util.unique(files)
11786         try:
11787             wlock = self.wlock()
11788             lock = self.lock()
11789             use_dirstate = (p1 is None) # not rawcommit
11790     
11791             if use_dirstate:
11792                 p1, p2 = self.dirstate.parents()
11793                 update_dirstate = True
11794     
11795                 if (not force and p2 != nullid and
11796                     (match and (match.files() or match.anypats()))):
11797                     raise util.Abort(_('cannot partially commit a merge '
11798                                        '(do not specify files or patterns)'))
11799     
11800                 if files:
11801                     modified, removed = [], []
11802                     for f in files:
11803                         s = self.dirstate[f]
11804                         if s in 'nma':
11805                             modified.append(f)
11806                         elif s == 'r':
11807                             removed.append(f)
11808                         else:
11809                             self.ui.warn(_("%s not tracked!\n") % f)
11810                     changes = [modified, [], removed, [], []]
11811                 else:
11812                     changes = self.status(match=match)
11813             else:
11814                 p1, p2 = p1, p2 or nullid
11815                 update_dirstate = (self.dirstate.parents()[0] == p1)
11816                 changes = [files, [], [], [], []]
11817     
11818             ms = merge_.mergestate(self)
11819             for f in changes[0]:
11820                 if f in ms and ms[f] == 'u':
11821                     raise util.Abort(_("unresolved merge conflicts "
11822                                                     "(see hg resolve)"))
11823             wctx = context.workingctx(self, (p1, p2), text, user, date,
11824                                       extra, changes)
11825             r = self._commitctx(wctx, force, force_editor, empty_ok,
11826 >                               use_dirstate, update_dirstate)
11827 
11828 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
11829 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11830 
11831     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
11832                   use_dirstate=True, update_dirstate=True):
11833         tr = None
11834         valid = 0 # don't save the dirstate if this isn't set
11835         try:
11836             commit = util.sort(wctx.modified() + wctx.added())
11837             remove = wctx.removed()
11838             extra = wctx.extra().copy()
11839             branchname = extra['branch']
11840             user = wctx.user()
11841             text = wctx.description()
11842     
11843             p1, p2 = [p.node() for p in wctx.parents()]
11844             c1 = self.changelog.read(p1)
11845             c2 = self.changelog.read(p2)
11846             m1 = self.manifest.read(c1[0]).copy()
11847             m2 = self.manifest.read(c2[0])
11848     
11849             if use_dirstate:
11850                 oldname = c1[5].get("branch") # stored in UTF-8
11851                 if (not commit and not remove and not force and p2 == nullid
11852                     and branchname == oldname):
11853                     self.ui.status(_("nothing changed\n"))
11854                     return None
11855     
11856             xp1 = hex(p1)
11857             if p2 == nullid: xp2 = ''
11858             else: xp2 = hex(p2)
11859     
11860             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
11861     
11862             tr = self.transaction()
11863             trp = weakref.proxy(tr)
11864     
11865             # check in files
11866             new = {}
11867             changed = []
11868             linkrev = len(self)
11869             for f in commit:
11870                 self.ui.note(f + "\n")
11871                 try:
11872                     fctx = wctx.filectx(f)
11873                     newflags = fctx.flags()
11874                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
11875                     if ((not changed or changed[-1] != f) and
11876                         m2.get(f) != new[f]):
11877                         # mention the file in the changelog if some
11878                         # flag changed, even if there was no content
11879                         # change.
11880                         if m1.flags(f) != newflags:
11881                             changed.append(f)
11882                     m1.set(f, newflags)
11883                     if use_dirstate:
11884                         self.dirstate.normal(f)
11885     
11886                 except (OSError, IOError):
11887                     if use_dirstate:
11888                         self.ui.warn(_("trouble committing %s!\n") % f)
11889                         raise
11890                     else:
11891                         remove.append(f)
11892     
11893             updated, added = [], []
11894             for f in util.sort(changed):
11895                 if f in m1 or f in m2:
11896                     updated.append(f)
11897                 else:
11898                     added.append(f)
11899     
11900             # update manifest
11901             m1.update(new)
11902             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
11903             removed1 = []
11904     
11905             for f in removed:
11906                 if f in m1:
11907                     del m1[f]
11908                     removed1.append(f)
11909             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
11910                                    (new, removed1))
11911     
11912             # add changeset
11913             if (not empty_ok and not text) or force_editor:
11914                 edittext = []
11915                 if text:
11916                     edittext.append(text)
11917                 edittext.append("")
11918                 edittext.append("") # Empty line between message and comments.
11919                 edittext.append(_("HG: Enter commit message."
11920                                   "  Lines beginning with 'HG:' are removed."))
11921                 edittext.append("HG: --")
11922                 edittext.append("HG: user: %s" % user)
11923                 if p2 != nullid:
11924                     edittext.append("HG: branch merge")
11925                 if branchname:
11926                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
11927                 edittext.extend(["HG: added %s" % f for f in added])
11928                 edittext.extend(["HG: changed %s" % f for f in updated])
11929                 edittext.extend(["HG: removed %s" % f for f in removed])
11930                 if not added and not updated and not removed:
11931                     edittext.append("HG: no files changed")
11932                 edittext.append("")
11933                 # run editor in the repository root
11934 E               olddir = os.getcwd()
11935 >               OSError: [Errno 2] No such file or directory
11936 
11937 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
11938 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
11939 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
11940 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
11941 HG: --
11942 HG: user: nobody
11943 HG: branch 'default'
11944 HG: added ab56b4d92b40713acc5af89985d4b786
11945 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
11946 Vim: Beendet.
11947 ]2;Terminal - Terminal]1;Terminal - Terminal
11948 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
11949 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
11950 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
11951 
11952 transaction abort!
11953 rollback completed
11954 transaction abort!
11955 rollback completed
11956 
11957 - - - - - - - - - - - - - -  [4]: recorded stderr - - - - - - - - - - - - - - -
11958 transaction abort!
11959 rollback completed
11960 
11961 ________________________________________________________________________________
11962  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[5] 
11963 
11964     def test_value(value, revno):
11965         item = self.backend.create_item('valid_values_%s' % revno)
11966         rev = item.create_revision(0)
11967         rev["key"] = value
11968 >       item.commit()
11969 
11970 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
11971 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11972 
11973     def commit(self):
11974         """
11975             @see: Backend._commit_item.__doc__
11976             """
11977         assert self._uncommitted_revision is not None
11978 >       self._backend._commit_item(self._uncommitted_revision)
11979 
11980 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
11981 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
11982 
11983     def _commit_item(self, revision, second_parent=None):
11984         """
11985             Commit given Item Revision to repository. Update and commit Item index file.
11986             If Revision already exists, raise RevisionAlreadyExistsError.
11987             """
11988         item = revision.item
11989         lock = self._lock_repo() #XXX: lock item only!
11990         try:
11991             if not item._id:
11992                 self._add_item(item)
11993             elif revision.revno in self._list_revisions(item):
11994                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
11995     
11996             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
11997             if revision.revno > 0:
11998                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
11999                 if second_parent:
12000                     parents.append(second_parent)
12001             else:
12002                 self._open_item_index(item, 'wb').close()
12003                 self._repo.add([item._id, "%s.rev" % item._id])
12004                 parents = []
12005             internal_meta = {'rev': revision.revno,
12006                              'name': item.name,
12007                              'id': item._id,
12008                              'parents': " ".join(parents)}
12009             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
12010             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
12011     
12012             if not revision.timestamp:
12013                 revision.timestamp = long(time.time())
12014             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
12015             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
12016             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
12017             try:
12018                 match = mercurial.match.exact(self._rev_path, '', [item._id])
12019 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
12020 
12021 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
12022 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12023 
12024     def commit(self, files=None, text="", user=None, date=None,
12025                match=None, force=False, force_editor=False,
12026                p1=None, p2=None, extra={}, empty_ok=False):
12027         wlock = lock = None
12028         if extra.get("close"):
12029             force = True
12030         if files:
12031             files = util.unique(files)
12032         try:
12033             wlock = self.wlock()
12034             lock = self.lock()
12035             use_dirstate = (p1 is None) # not rawcommit
12036     
12037             if use_dirstate:
12038                 p1, p2 = self.dirstate.parents()
12039                 update_dirstate = True
12040     
12041                 if (not force and p2 != nullid and
12042                     (match and (match.files() or match.anypats()))):
12043                     raise util.Abort(_('cannot partially commit a merge '
12044                                        '(do not specify files or patterns)'))
12045     
12046                 if files:
12047                     modified, removed = [], []
12048                     for f in files:
12049                         s = self.dirstate[f]
12050                         if s in 'nma':
12051                             modified.append(f)
12052                         elif s == 'r':
12053                             removed.append(f)
12054                         else:
12055                             self.ui.warn(_("%s not tracked!\n") % f)
12056                     changes = [modified, [], removed, [], []]
12057                 else:
12058                     changes = self.status(match=match)
12059             else:
12060                 p1, p2 = p1, p2 or nullid
12061                 update_dirstate = (self.dirstate.parents()[0] == p1)
12062                 changes = [files, [], [], [], []]
12063     
12064             ms = merge_.mergestate(self)
12065             for f in changes[0]:
12066                 if f in ms and ms[f] == 'u':
12067                     raise util.Abort(_("unresolved merge conflicts "
12068                                                     "(see hg resolve)"))
12069             wctx = context.workingctx(self, (p1, p2), text, user, date,
12070                                       extra, changes)
12071             r = self._commitctx(wctx, force, force_editor, empty_ok,
12072 >                               use_dirstate, update_dirstate)
12073 
12074 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
12075 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12076 
12077     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
12078                   use_dirstate=True, update_dirstate=True):
12079         tr = None
12080         valid = 0 # don't save the dirstate if this isn't set
12081         try:
12082             commit = util.sort(wctx.modified() + wctx.added())
12083             remove = wctx.removed()
12084             extra = wctx.extra().copy()
12085             branchname = extra['branch']
12086             user = wctx.user()
12087             text = wctx.description()
12088     
12089             p1, p2 = [p.node() for p in wctx.parents()]
12090             c1 = self.changelog.read(p1)
12091             c2 = self.changelog.read(p2)
12092             m1 = self.manifest.read(c1[0]).copy()
12093             m2 = self.manifest.read(c2[0])
12094     
12095             if use_dirstate:
12096                 oldname = c1[5].get("branch") # stored in UTF-8
12097                 if (not commit and not remove and not force and p2 == nullid
12098                     and branchname == oldname):
12099                     self.ui.status(_("nothing changed\n"))
12100                     return None
12101     
12102             xp1 = hex(p1)
12103             if p2 == nullid: xp2 = ''
12104             else: xp2 = hex(p2)
12105     
12106             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
12107     
12108             tr = self.transaction()
12109             trp = weakref.proxy(tr)
12110     
12111             # check in files
12112             new = {}
12113             changed = []
12114             linkrev = len(self)
12115             for f in commit:
12116                 self.ui.note(f + "\n")
12117                 try:
12118                     fctx = wctx.filectx(f)
12119                     newflags = fctx.flags()
12120                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
12121                     if ((not changed or changed[-1] != f) and
12122                         m2.get(f) != new[f]):
12123                         # mention the file in the changelog if some
12124                         # flag changed, even if there was no content
12125                         # change.
12126                         if m1.flags(f) != newflags:
12127                             changed.append(f)
12128                     m1.set(f, newflags)
12129                     if use_dirstate:
12130                         self.dirstate.normal(f)
12131     
12132                 except (OSError, IOError):
12133                     if use_dirstate:
12134                         self.ui.warn(_("trouble committing %s!\n") % f)
12135                         raise
12136                     else:
12137                         remove.append(f)
12138     
12139             updated, added = [], []
12140             for f in util.sort(changed):
12141                 if f in m1 or f in m2:
12142                     updated.append(f)
12143                 else:
12144                     added.append(f)
12145     
12146             # update manifest
12147             m1.update(new)
12148             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
12149             removed1 = []
12150     
12151             for f in removed:
12152                 if f in m1:
12153                     del m1[f]
12154                     removed1.append(f)
12155             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
12156                                    (new, removed1))
12157     
12158             # add changeset
12159             if (not empty_ok and not text) or force_editor:
12160                 edittext = []
12161                 if text:
12162                     edittext.append(text)
12163                 edittext.append("")
12164                 edittext.append("") # Empty line between message and comments.
12165                 edittext.append(_("HG: Enter commit message."
12166                                   "  Lines beginning with 'HG:' are removed."))
12167                 edittext.append("HG: --")
12168                 edittext.append("HG: user: %s" % user)
12169                 if p2 != nullid:
12170                     edittext.append("HG: branch merge")
12171                 if branchname:
12172                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
12173                 edittext.extend(["HG: added %s" % f for f in added])
12174                 edittext.extend(["HG: changed %s" % f for f in updated])
12175                 edittext.extend(["HG: removed %s" % f for f in removed])
12176                 if not added and not updated and not removed:
12177                     edittext.append("HG: no files changed")
12178                 edittext.append("")
12179                 # run editor in the repository root
12180 E               olddir = os.getcwd()
12181 >               OSError: [Errno 2] No such file or directory
12182 
12183 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
12184 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
12185 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
12186 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
12187 HG: --
12188 HG: user: nobody
12189 HG: branch 'default'
12190 HG: added ab56b4d92b40713acc5af89985d4b786
12191 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
12192 Vim: Beendet.
12193 ]2;Terminal - Terminal]1;Terminal - Terminal
12194 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
12195 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
12196 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
12197 
12198 transaction abort!
12199 rollback completed
12200 transaction abort!
12201 rollback completed
12202 
12203 - - - - - - - - - - - - - -  [5]: recorded stderr - - - - - - - - - - - - - - -
12204 transaction abort!
12205 rollback completed
12206 
12207 ________________________________________________________________________________
12208  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[6] 
12209 
12210     def test_value(value, revno):
12211         item = self.backend.create_item('valid_values_%s' % revno)
12212         rev = item.create_revision(0)
12213         rev["key"] = value
12214 >       item.commit()
12215 
12216 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
12217 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12218 
12219     def commit(self):
12220         """
12221             @see: Backend._commit_item.__doc__
12222             """
12223         assert self._uncommitted_revision is not None
12224 >       self._backend._commit_item(self._uncommitted_revision)
12225 
12226 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
12227 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12228 
12229     def _commit_item(self, revision, second_parent=None):
12230         """
12231             Commit given Item Revision to repository. Update and commit Item index file.
12232             If Revision already exists, raise RevisionAlreadyExistsError.
12233             """
12234         item = revision.item
12235         lock = self._lock_repo() #XXX: lock item only!
12236         try:
12237             if not item._id:
12238                 self._add_item(item)
12239             elif revision.revno in self._list_revisions(item):
12240                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
12241     
12242             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
12243             if revision.revno > 0:
12244                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
12245                 if second_parent:
12246                     parents.append(second_parent)
12247             else:
12248                 self._open_item_index(item, 'wb').close()
12249                 self._repo.add([item._id, "%s.rev" % item._id])
12250                 parents = []
12251             internal_meta = {'rev': revision.revno,
12252                              'name': item.name,
12253                              'id': item._id,
12254                              'parents': " ".join(parents)}
12255             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
12256             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
12257     
12258             if not revision.timestamp:
12259                 revision.timestamp = long(time.time())
12260             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
12261             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
12262             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
12263             try:
12264                 match = mercurial.match.exact(self._rev_path, '', [item._id])
12265 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
12266 
12267 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
12268 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12269 
12270     def commit(self, files=None, text="", user=None, date=None,
12271                match=None, force=False, force_editor=False,
12272                p1=None, p2=None, extra={}, empty_ok=False):
12273         wlock = lock = None
12274         if extra.get("close"):
12275             force = True
12276         if files:
12277             files = util.unique(files)
12278         try:
12279             wlock = self.wlock()
12280             lock = self.lock()
12281             use_dirstate = (p1 is None) # not rawcommit
12282     
12283             if use_dirstate:
12284                 p1, p2 = self.dirstate.parents()
12285                 update_dirstate = True
12286     
12287                 if (not force and p2 != nullid and
12288                     (match and (match.files() or match.anypats()))):
12289                     raise util.Abort(_('cannot partially commit a merge '
12290                                        '(do not specify files or patterns)'))
12291     
12292                 if files:
12293                     modified, removed = [], []
12294                     for f in files:
12295                         s = self.dirstate[f]
12296                         if s in 'nma':
12297                             modified.append(f)
12298                         elif s == 'r':
12299                             removed.append(f)
12300                         else:
12301                             self.ui.warn(_("%s not tracked!\n") % f)
12302                     changes = [modified, [], removed, [], []]
12303                 else:
12304                     changes = self.status(match=match)
12305             else:
12306                 p1, p2 = p1, p2 or nullid
12307                 update_dirstate = (self.dirstate.parents()[0] == p1)
12308                 changes = [files, [], [], [], []]
12309     
12310             ms = merge_.mergestate(self)
12311             for f in changes[0]:
12312                 if f in ms and ms[f] == 'u':
12313                     raise util.Abort(_("unresolved merge conflicts "
12314                                                     "(see hg resolve)"))
12315             wctx = context.workingctx(self, (p1, p2), text, user, date,
12316                                       extra, changes)
12317             r = self._commitctx(wctx, force, force_editor, empty_ok,
12318 >                               use_dirstate, update_dirstate)
12319 
12320 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
12321 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12322 
12323     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
12324                   use_dirstate=True, update_dirstate=True):
12325         tr = None
12326         valid = 0 # don't save the dirstate if this isn't set
12327         try:
12328             commit = util.sort(wctx.modified() + wctx.added())
12329             remove = wctx.removed()
12330             extra = wctx.extra().copy()
12331             branchname = extra['branch']
12332             user = wctx.user()
12333             text = wctx.description()
12334     
12335             p1, p2 = [p.node() for p in wctx.parents()]
12336             c1 = self.changelog.read(p1)
12337             c2 = self.changelog.read(p2)
12338             m1 = self.manifest.read(c1[0]).copy()
12339             m2 = self.manifest.read(c2[0])
12340     
12341             if use_dirstate:
12342                 oldname = c1[5].get("branch") # stored in UTF-8
12343                 if (not commit and not remove and not force and p2 == nullid
12344                     and branchname == oldname):
12345                     self.ui.status(_("nothing changed\n"))
12346                     return None
12347     
12348             xp1 = hex(p1)
12349             if p2 == nullid: xp2 = ''
12350             else: xp2 = hex(p2)
12351     
12352             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
12353     
12354             tr = self.transaction()
12355             trp = weakref.proxy(tr)
12356     
12357             # check in files
12358             new = {}
12359             changed = []
12360             linkrev = len(self)
12361             for f in commit:
12362                 self.ui.note(f + "\n")
12363                 try:
12364                     fctx = wctx.filectx(f)
12365                     newflags = fctx.flags()
12366                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
12367                     if ((not changed or changed[-1] != f) and
12368                         m2.get(f) != new[f]):
12369                         # mention the file in the changelog if some
12370                         # flag changed, even if there was no content
12371                         # change.
12372                         if m1.flags(f) != newflags:
12373                             changed.append(f)
12374                     m1.set(f, newflags)
12375                     if use_dirstate:
12376                         self.dirstate.normal(f)
12377     
12378                 except (OSError, IOError):
12379                     if use_dirstate:
12380                         self.ui.warn(_("trouble committing %s!\n") % f)
12381                         raise
12382                     else:
12383                         remove.append(f)
12384     
12385             updated, added = [], []
12386             for f in util.sort(changed):
12387                 if f in m1 or f in m2:
12388                     updated.append(f)
12389                 else:
12390                     added.append(f)
12391     
12392             # update manifest
12393             m1.update(new)
12394             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
12395             removed1 = []
12396     
12397             for f in removed:
12398                 if f in m1:
12399                     del m1[f]
12400                     removed1.append(f)
12401             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
12402                                    (new, removed1))
12403     
12404             # add changeset
12405             if (not empty_ok and not text) or force_editor:
12406                 edittext = []
12407                 if text:
12408                     edittext.append(text)
12409                 edittext.append("")
12410                 edittext.append("") # Empty line between message and comments.
12411                 edittext.append(_("HG: Enter commit message."
12412                                   "  Lines beginning with 'HG:' are removed."))
12413                 edittext.append("HG: --")
12414                 edittext.append("HG: user: %s" % user)
12415                 if p2 != nullid:
12416                     edittext.append("HG: branch merge")
12417                 if branchname:
12418                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
12419                 edittext.extend(["HG: added %s" % f for f in added])
12420                 edittext.extend(["HG: changed %s" % f for f in updated])
12421                 edittext.extend(["HG: removed %s" % f for f in removed])
12422                 if not added and not updated and not removed:
12423                     edittext.append("HG: no files changed")
12424                 edittext.append("")
12425                 # run editor in the repository root
12426 E               olddir = os.getcwd()
12427 >               OSError: [Errno 2] No such file or directory
12428 
12429 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
12430 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
12431 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
12432 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
12433 HG: --
12434 HG: user: nobody
12435 HG: branch 'default'
12436 HG: added ab56b4d92b40713acc5af89985d4b786
12437 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
12438 Vim: Beendet.
12439 ]2;Terminal - Terminal]1;Terminal - Terminal
12440 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
12441 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
12442 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
12443 
12444 transaction abort!
12445 rollback completed
12446 transaction abort!
12447 rollback completed
12448 
12449 - - - - - - - - - - - - - -  [6]: recorded stderr - - - - - - - - - - - - - - -
12450 transaction abort!
12451 rollback completed
12452 
12453 ________________________________________________________________________________
12454  entrypoint: test_backends_hg.py TestMercurialBackend().test_various_revision_metadata_values[7] 
12455 
12456     def test_value(value, revno):
12457         item = self.backend.create_item('valid_values_%s' % revno)
12458         rev = item.create_revision(0)
12459         rev["key"] = value
12460 >       item.commit()
12461 
12462 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:580]
12463 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12464 
12465     def commit(self):
12466         """
12467             @see: Backend._commit_item.__doc__
12468             """
12469         assert self._uncommitted_revision is not None
12470 >       self._backend._commit_item(self._uncommitted_revision)
12471 
12472 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
12473 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12474 
12475     def _commit_item(self, revision, second_parent=None):
12476         """
12477             Commit given Item Revision to repository. Update and commit Item index file.
12478             If Revision already exists, raise RevisionAlreadyExistsError.
12479             """
12480         item = revision.item
12481         lock = self._lock_repo() #XXX: lock item only!
12482         try:
12483             if not item._id:
12484                 self._add_item(item)
12485             elif revision.revno in self._list_revisions(item):
12486                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
12487     
12488             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
12489             if revision.revno > 0:
12490                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
12491                 if second_parent:
12492                     parents.append(second_parent)
12493             else:
12494                 self._open_item_index(item, 'wb').close()
12495                 self._repo.add([item._id, "%s.rev" % item._id])
12496                 parents = []
12497             internal_meta = {'rev': revision.revno,
12498                              'name': item.name,
12499                              'id': item._id,
12500                              'parents': " ".join(parents)}
12501             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
12502             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
12503     
12504             if not revision.timestamp:
12505                 revision.timestamp = long(time.time())
12506             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
12507             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
12508             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
12509             try:
12510                 match = mercurial.match.exact(self._rev_path, '', [item._id])
12511 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
12512 
12513 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
12514 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12515 
12516     def commit(self, files=None, text="", user=None, date=None,
12517                match=None, force=False, force_editor=False,
12518                p1=None, p2=None, extra={}, empty_ok=False):
12519         wlock = lock = None
12520         if extra.get("close"):
12521             force = True
12522         if files:
12523             files = util.unique(files)
12524         try:
12525             wlock = self.wlock()
12526             lock = self.lock()
12527             use_dirstate = (p1 is None) # not rawcommit
12528     
12529             if use_dirstate:
12530                 p1, p2 = self.dirstate.parents()
12531                 update_dirstate = True
12532     
12533                 if (not force and p2 != nullid and
12534                     (match and (match.files() or match.anypats()))):
12535                     raise util.Abort(_('cannot partially commit a merge '
12536                                        '(do not specify files or patterns)'))
12537     
12538                 if files:
12539                     modified, removed = [], []
12540                     for f in files:
12541                         s = self.dirstate[f]
12542                         if s in 'nma':
12543                             modified.append(f)
12544                         elif s == 'r':
12545                             removed.append(f)
12546                         else:
12547                             self.ui.warn(_("%s not tracked!\n") % f)
12548                     changes = [modified, [], removed, [], []]
12549                 else:
12550                     changes = self.status(match=match)
12551             else:
12552                 p1, p2 = p1, p2 or nullid
12553                 update_dirstate = (self.dirstate.parents()[0] == p1)
12554                 changes = [files, [], [], [], []]
12555     
12556             ms = merge_.mergestate(self)
12557             for f in changes[0]:
12558                 if f in ms and ms[f] == 'u':
12559                     raise util.Abort(_("unresolved merge conflicts "
12560                                                     "(see hg resolve)"))
12561             wctx = context.workingctx(self, (p1, p2), text, user, date,
12562                                       extra, changes)
12563             r = self._commitctx(wctx, force, force_editor, empty_ok,
12564 >                               use_dirstate, update_dirstate)
12565 
12566 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
12567 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12568 
12569     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
12570                   use_dirstate=True, update_dirstate=True):
12571         tr = None
12572         valid = 0 # don't save the dirstate if this isn't set
12573         try:
12574             commit = util.sort(wctx.modified() + wctx.added())
12575             remove = wctx.removed()
12576             extra = wctx.extra().copy()
12577             branchname = extra['branch']
12578             user = wctx.user()
12579             text = wctx.description()
12580     
12581             p1, p2 = [p.node() for p in wctx.parents()]
12582             c1 = self.changelog.read(p1)
12583             c2 = self.changelog.read(p2)
12584             m1 = self.manifest.read(c1[0]).copy()
12585             m2 = self.manifest.read(c2[0])
12586     
12587             if use_dirstate:
12588                 oldname = c1[5].get("branch") # stored in UTF-8
12589                 if (not commit and not remove and not force and p2 == nullid
12590                     and branchname == oldname):
12591                     self.ui.status(_("nothing changed\n"))
12592                     return None
12593     
12594             xp1 = hex(p1)
12595             if p2 == nullid: xp2 = ''
12596             else: xp2 = hex(p2)
12597     
12598             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
12599     
12600             tr = self.transaction()
12601             trp = weakref.proxy(tr)
12602     
12603             # check in files
12604             new = {}
12605             changed = []
12606             linkrev = len(self)
12607             for f in commit:
12608                 self.ui.note(f + "\n")
12609                 try:
12610                     fctx = wctx.filectx(f)
12611                     newflags = fctx.flags()
12612                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
12613                     if ((not changed or changed[-1] != f) and
12614                         m2.get(f) != new[f]):
12615                         # mention the file in the changelog if some
12616                         # flag changed, even if there was no content
12617                         # change.
12618                         if m1.flags(f) != newflags:
12619                             changed.append(f)
12620                     m1.set(f, newflags)
12621                     if use_dirstate:
12622                         self.dirstate.normal(f)
12623     
12624                 except (OSError, IOError):
12625                     if use_dirstate:
12626                         self.ui.warn(_("trouble committing %s!\n") % f)
12627                         raise
12628                     else:
12629                         remove.append(f)
12630     
12631             updated, added = [], []
12632             for f in util.sort(changed):
12633                 if f in m1 or f in m2:
12634                     updated.append(f)
12635                 else:
12636                     added.append(f)
12637     
12638             # update manifest
12639             m1.update(new)
12640             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
12641             removed1 = []
12642     
12643             for f in removed:
12644                 if f in m1:
12645                     del m1[f]
12646                     removed1.append(f)
12647             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
12648                                    (new, removed1))
12649     
12650             # add changeset
12651             if (not empty_ok and not text) or force_editor:
12652                 edittext = []
12653                 if text:
12654                     edittext.append(text)
12655                 edittext.append("")
12656                 edittext.append("") # Empty line between message and comments.
12657                 edittext.append(_("HG: Enter commit message."
12658                                   "  Lines beginning with 'HG:' are removed."))
12659                 edittext.append("HG: --")
12660                 edittext.append("HG: user: %s" % user)
12661                 if p2 != nullid:
12662                     edittext.append("HG: branch merge")
12663                 if branchname:
12664                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
12665                 edittext.extend(["HG: added %s" % f for f in added])
12666                 edittext.extend(["HG: changed %s" % f for f in updated])
12667                 edittext.extend(["HG: removed %s" % f for f in removed])
12668                 if not added and not updated and not removed:
12669                     edittext.append("HG: no files changed")
12670                 edittext.append("")
12671                 # run editor in the repository root
12672 E               olddir = os.getcwd()
12673 >               OSError: [Errno 2] No such file or directory
12674 
12675 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
12676 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
12677 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
12678 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
12679 HG: --
12680 HG: user: nobody
12681 HG: branch 'default'
12682 HG: added ab56b4d92b40713acc5af89985d4b786
12683 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
12684 Vim: Beendet.
12685 ]2;Terminal - Terminal]1;Terminal - Terminal
12686 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
12687 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
12688 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
12689 
12690 transaction abort!
12691 rollback completed
12692 transaction abort!
12693 rollback completed
12694 
12695 - - - - - - - - - - - - - -  [7]: recorded stderr - - - - - - - - - - - - - - -
12696 transaction abort!
12697 rollback completed
12698 
12699 ________________________________________________________________________________
12700 _____ entrypoint: test_backends_hg.py TestMercurialBackend().test_history ______
12701 
12702     def test_history(self):
12703         order = [('first', 0, ), ('second', 0, ), ('first', 1, ), ('a', 0), ('child/my_subitem', 0) ]
12704         for name, revno in order:
12705             if revno == 0:
12706                 item = self.backend.create_item(name)
12707             else:
12708                 item = self.backend.get_item(name)
12709             item.create_revision(revno)
12710 >           item.commit()
12711 
12712 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:596]
12713 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12714 
12715     def commit(self):
12716         """
12717             @see: Backend._commit_item.__doc__
12718             """
12719         assert self._uncommitted_revision is not None
12720 >       self._backend._commit_item(self._uncommitted_revision)
12721 
12722 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
12723 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12724 
12725     def _commit_item(self, revision, second_parent=None):
12726         """
12727             Commit given Item Revision to repository. Update and commit Item index file.
12728             If Revision already exists, raise RevisionAlreadyExistsError.
12729             """
12730         item = revision.item
12731         lock = self._lock_repo() #XXX: lock item only!
12732         try:
12733             if not item._id:
12734                 self._add_item(item)
12735             elif revision.revno in self._list_revisions(item):
12736                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
12737     
12738             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
12739             if revision.revno > 0:
12740                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
12741                 if second_parent:
12742                     parents.append(second_parent)
12743             else:
12744                 self._open_item_index(item, 'wb').close()
12745                 self._repo.add([item._id, "%s.rev" % item._id])
12746                 parents = []
12747             internal_meta = {'rev': revision.revno,
12748                              'name': item.name,
12749                              'id': item._id,
12750                              'parents': " ".join(parents)}
12751             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
12752             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
12753     
12754             if not revision.timestamp:
12755                 revision.timestamp = long(time.time())
12756             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
12757             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
12758             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
12759             try:
12760                 match = mercurial.match.exact(self._rev_path, '', [item._id])
12761 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
12762 
12763 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
12764 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12765 
12766     def commit(self, files=None, text="", user=None, date=None,
12767                match=None, force=False, force_editor=False,
12768                p1=None, p2=None, extra={}, empty_ok=False):
12769         wlock = lock = None
12770         if extra.get("close"):
12771             force = True
12772         if files:
12773             files = util.unique(files)
12774         try:
12775             wlock = self.wlock()
12776             lock = self.lock()
12777             use_dirstate = (p1 is None) # not rawcommit
12778     
12779             if use_dirstate:
12780                 p1, p2 = self.dirstate.parents()
12781                 update_dirstate = True
12782     
12783                 if (not force and p2 != nullid and
12784                     (match and (match.files() or match.anypats()))):
12785                     raise util.Abort(_('cannot partially commit a merge '
12786                                        '(do not specify files or patterns)'))
12787     
12788                 if files:
12789                     modified, removed = [], []
12790                     for f in files:
12791                         s = self.dirstate[f]
12792                         if s in 'nma':
12793                             modified.append(f)
12794                         elif s == 'r':
12795                             removed.append(f)
12796                         else:
12797                             self.ui.warn(_("%s not tracked!\n") % f)
12798                     changes = [modified, [], removed, [], []]
12799                 else:
12800                     changes = self.status(match=match)
12801             else:
12802                 p1, p2 = p1, p2 or nullid
12803                 update_dirstate = (self.dirstate.parents()[0] == p1)
12804                 changes = [files, [], [], [], []]
12805     
12806             ms = merge_.mergestate(self)
12807             for f in changes[0]:
12808                 if f in ms and ms[f] == 'u':
12809                     raise util.Abort(_("unresolved merge conflicts "
12810                                                     "(see hg resolve)"))
12811             wctx = context.workingctx(self, (p1, p2), text, user, date,
12812                                       extra, changes)
12813             r = self._commitctx(wctx, force, force_editor, empty_ok,
12814 >                               use_dirstate, update_dirstate)
12815 
12816 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
12817 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12818 
12819     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
12820                   use_dirstate=True, update_dirstate=True):
12821         tr = None
12822         valid = 0 # don't save the dirstate if this isn't set
12823         try:
12824             commit = util.sort(wctx.modified() + wctx.added())
12825             remove = wctx.removed()
12826             extra = wctx.extra().copy()
12827             branchname = extra['branch']
12828             user = wctx.user()
12829             text = wctx.description()
12830     
12831             p1, p2 = [p.node() for p in wctx.parents()]
12832             c1 = self.changelog.read(p1)
12833             c2 = self.changelog.read(p2)
12834             m1 = self.manifest.read(c1[0]).copy()
12835             m2 = self.manifest.read(c2[0])
12836     
12837             if use_dirstate:
12838                 oldname = c1[5].get("branch") # stored in UTF-8
12839                 if (not commit and not remove and not force and p2 == nullid
12840                     and branchname == oldname):
12841                     self.ui.status(_("nothing changed\n"))
12842                     return None
12843     
12844             xp1 = hex(p1)
12845             if p2 == nullid: xp2 = ''
12846             else: xp2 = hex(p2)
12847     
12848             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
12849     
12850             tr = self.transaction()
12851             trp = weakref.proxy(tr)
12852     
12853             # check in files
12854             new = {}
12855             changed = []
12856             linkrev = len(self)
12857             for f in commit:
12858                 self.ui.note(f + "\n")
12859                 try:
12860                     fctx = wctx.filectx(f)
12861                     newflags = fctx.flags()
12862                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
12863                     if ((not changed or changed[-1] != f) and
12864                         m2.get(f) != new[f]):
12865                         # mention the file in the changelog if some
12866                         # flag changed, even if there was no content
12867                         # change.
12868                         if m1.flags(f) != newflags:
12869                             changed.append(f)
12870                     m1.set(f, newflags)
12871                     if use_dirstate:
12872                         self.dirstate.normal(f)
12873     
12874                 except (OSError, IOError):
12875                     if use_dirstate:
12876                         self.ui.warn(_("trouble committing %s!\n") % f)
12877                         raise
12878                     else:
12879                         remove.append(f)
12880     
12881             updated, added = [], []
12882             for f in util.sort(changed):
12883                 if f in m1 or f in m2:
12884                     updated.append(f)
12885                 else:
12886                     added.append(f)
12887     
12888             # update manifest
12889             m1.update(new)
12890             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
12891             removed1 = []
12892     
12893             for f in removed:
12894                 if f in m1:
12895                     del m1[f]
12896                     removed1.append(f)
12897             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
12898                                    (new, removed1))
12899     
12900             # add changeset
12901             if (not empty_ok and not text) or force_editor:
12902                 edittext = []
12903                 if text:
12904                     edittext.append(text)
12905                 edittext.append("")
12906                 edittext.append("") # Empty line between message and comments.
12907                 edittext.append(_("HG: Enter commit message."
12908                                   "  Lines beginning with 'HG:' are removed."))
12909                 edittext.append("HG: --")
12910                 edittext.append("HG: user: %s" % user)
12911                 if p2 != nullid:
12912                     edittext.append("HG: branch merge")
12913                 if branchname:
12914                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
12915                 edittext.extend(["HG: added %s" % f for f in added])
12916                 edittext.extend(["HG: changed %s" % f for f in updated])
12917                 edittext.extend(["HG: removed %s" % f for f in removed])
12918                 if not added and not updated and not removed:
12919                     edittext.append("HG: no files changed")
12920                 edittext.append("")
12921                 # run editor in the repository root
12922 E               olddir = os.getcwd()
12923 >               OSError: [Errno 2] No such file or directory
12924 
12925 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
12926 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
12927 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
12928 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
12929 HG: --
12930 HG: user: nobody
12931 HG: branch 'default'
12932 HG: added ab56b4d92b40713acc5af89985d4b786
12933 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
12934 Vim: Beendet.
12935 ]2;Terminal - Terminal]1;Terminal - Terminal
12936 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
12937 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
12938 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
12939 
12940 transaction abort!
12941 rollback completed
12942 transaction abort!
12943 rollback completed
12944 
12945 - - - - - - - - - - - -  test_history: recorded stderr - - - - - - - - - - - - -
12946 transaction abort!
12947 rollback completed
12948 
12949 ________________________________________________________________________________
12950 ___ entrypoint: test_backends_hg.py TestMercurialBackend().test_destroy_item ___
12951 
12952     def test_destroy_item(self):
12953         itemname = "I will be completely destroyed"
12954         rev_data = "I will be completely destroyed, too, hopefully"
12955         item = self.backend.create_item(itemname)
12956         rev = item.create_revision(0)
12957         rev.write(rev_data)
12958 >       item.commit()
12959 
12960 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends.py:634]
12961 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12962 
12963     def commit(self):
12964         """
12965             @see: Backend._commit_item.__doc__
12966             """
12967         assert self._uncommitted_revision is not None
12968 >       self._backend._commit_item(self._uncommitted_revision)
12969 
12970 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
12971 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
12972 
12973     def _commit_item(self, revision, second_parent=None):
12974         """
12975             Commit given Item Revision to repository. Update and commit Item index file.
12976             If Revision already exists, raise RevisionAlreadyExistsError.
12977             """
12978         item = revision.item
12979         lock = self._lock_repo() #XXX: lock item only!
12980         try:
12981             if not item._id:
12982                 self._add_item(item)
12983             elif revision.revno in self._list_revisions(item):
12984                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
12985     
12986             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
12987             if revision.revno > 0:
12988                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
12989                 if second_parent:
12990                     parents.append(second_parent)
12991             else:
12992                 self._open_item_index(item, 'wb').close()
12993                 self._repo.add([item._id, "%s.rev" % item._id])
12994                 parents = []
12995             internal_meta = {'rev': revision.revno,
12996                              'name': item.name,
12997                              'id': item._id,
12998                              'parents': " ".join(parents)}
12999             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
13000             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
13001     
13002             if not revision.timestamp:
13003                 revision.timestamp = long(time.time())
13004             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
13005             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
13006             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
13007             try:
13008                 match = mercurial.match.exact(self._rev_path, '', [item._id])
13009 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
13010 
13011 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
13012 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13013 
13014     def commit(self, files=None, text="", user=None, date=None,
13015                match=None, force=False, force_editor=False,
13016                p1=None, p2=None, extra={}, empty_ok=False):
13017         wlock = lock = None
13018         if extra.get("close"):
13019             force = True
13020         if files:
13021             files = util.unique(files)
13022         try:
13023             wlock = self.wlock()
13024             lock = self.lock()
13025             use_dirstate = (p1 is None) # not rawcommit
13026     
13027             if use_dirstate:
13028                 p1, p2 = self.dirstate.parents()
13029                 update_dirstate = True
13030     
13031                 if (not force and p2 != nullid and
13032                     (match and (match.files() or match.anypats()))):
13033                     raise util.Abort(_('cannot partially commit a merge '
13034                                        '(do not specify files or patterns)'))
13035     
13036                 if files:
13037                     modified, removed = [], []
13038                     for f in files:
13039                         s = self.dirstate[f]
13040                         if s in 'nma':
13041                             modified.append(f)
13042                         elif s == 'r':
13043                             removed.append(f)
13044                         else:
13045                             self.ui.warn(_("%s not tracked!\n") % f)
13046                     changes = [modified, [], removed, [], []]
13047                 else:
13048                     changes = self.status(match=match)
13049             else:
13050                 p1, p2 = p1, p2 or nullid
13051                 update_dirstate = (self.dirstate.parents()[0] == p1)
13052                 changes = [files, [], [], [], []]
13053     
13054             ms = merge_.mergestate(self)
13055             for f in changes[0]:
13056                 if f in ms and ms[f] == 'u':
13057                     raise util.Abort(_("unresolved merge conflicts "
13058                                                     "(see hg resolve)"))
13059             wctx = context.workingctx(self, (p1, p2), text, user, date,
13060                                       extra, changes)
13061             r = self._commitctx(wctx, force, force_editor, empty_ok,
13062 >                               use_dirstate, update_dirstate)
13063 
13064 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
13065 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13066 
13067     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
13068                   use_dirstate=True, update_dirstate=True):
13069         tr = None
13070         valid = 0 # don't save the dirstate if this isn't set
13071         try:
13072             commit = util.sort(wctx.modified() + wctx.added())
13073             remove = wctx.removed()
13074             extra = wctx.extra().copy()
13075             branchname = extra['branch']
13076             user = wctx.user()
13077             text = wctx.description()
13078     
13079             p1, p2 = [p.node() for p in wctx.parents()]
13080             c1 = self.changelog.read(p1)
13081             c2 = self.changelog.read(p2)
13082             m1 = self.manifest.read(c1[0]).copy()
13083             m2 = self.manifest.read(c2[0])
13084     
13085             if use_dirstate:
13086                 oldname = c1[5].get("branch") # stored in UTF-8
13087                 if (not commit and not remove and not force and p2 == nullid
13088                     and branchname == oldname):
13089                     self.ui.status(_("nothing changed\n"))
13090                     return None
13091     
13092             xp1 = hex(p1)
13093             if p2 == nullid: xp2 = ''
13094             else: xp2 = hex(p2)
13095     
13096             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
13097     
13098             tr = self.transaction()
13099             trp = weakref.proxy(tr)
13100     
13101             # check in files
13102             new = {}
13103             changed = []
13104             linkrev = len(self)
13105             for f in commit:
13106                 self.ui.note(f + "\n")
13107                 try:
13108                     fctx = wctx.filectx(f)
13109                     newflags = fctx.flags()
13110                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
13111                     if ((not changed or changed[-1] != f) and
13112                         m2.get(f) != new[f]):
13113                         # mention the file in the changelog if some
13114                         # flag changed, even if there was no content
13115                         # change.
13116                         if m1.flags(f) != newflags:
13117                             changed.append(f)
13118                     m1.set(f, newflags)
13119                     if use_dirstate:
13120                         self.dirstate.normal(f)
13121     
13122                 except (OSError, IOError):
13123                     if use_dirstate:
13124                         self.ui.warn(_("trouble committing %s!\n") % f)
13125                         raise
13126                     else:
13127                         remove.append(f)
13128     
13129             updated, added = [], []
13130             for f in util.sort(changed):
13131                 if f in m1 or f in m2:
13132                     updated.append(f)
13133                 else:
13134                     added.append(f)
13135     
13136             # update manifest
13137             m1.update(new)
13138             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
13139             removed1 = []
13140     
13141             for f in removed:
13142                 if f in m1:
13143                     del m1[f]
13144                     removed1.append(f)
13145             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
13146                                    (new, removed1))
13147     
13148             # add changeset
13149             if (not empty_ok and not text) or force_editor:
13150                 edittext = []
13151                 if text:
13152                     edittext.append(text)
13153                 edittext.append("")
13154                 edittext.append("") # Empty line between message and comments.
13155                 edittext.append(_("HG: Enter commit message."
13156                                   "  Lines beginning with 'HG:' are removed."))
13157                 edittext.append("HG: --")
13158                 edittext.append("HG: user: %s" % user)
13159                 if p2 != nullid:
13160                     edittext.append("HG: branch merge")
13161                 if branchname:
13162                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
13163                 edittext.extend(["HG: added %s" % f for f in added])
13164                 edittext.extend(["HG: changed %s" % f for f in updated])
13165                 edittext.extend(["HG: removed %s" % f for f in removed])
13166                 if not added and not updated and not removed:
13167                     edittext.append("HG: no files changed")
13168                 edittext.append("")
13169                 # run editor in the repository root
13170 E               olddir = os.getcwd()
13171 >               OSError: [Errno 2] No such file or directory
13172 
13173 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
13174 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
13175 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
13176 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
13177 HG: --
13178 HG: user: nobody
13179 HG: branch 'default'
13180 HG: added ab56b4d92b40713acc5af89985d4b786
13181 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
13182 Vim: Beendet.
13183 ]2;Terminal - Terminal]1;Terminal - Terminal
13184 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
13185 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
13186 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
13187 
13188 transaction abort!
13189 rollback completed
13190 transaction abort!
13191 rollback completed
13192 
13193 - - - - - - - - - - -  test_destroy_item: recorded stderr - - - - - - - - - - - 
13194 transaction abort!
13195 rollback completed
13196 
13197 ________________________________________________________________________________
13198 _________ entrypoint: TestMercurialBackend().test_large_revision_meta __________
13199 
13200     def test_large_revision_meta(self):
13201         item = self.backend.create_item('existing')
13202         rev = item.create_revision(0)
13203         for num in xrange(10000):
13204             revval = "revision metatdata value for key %d" % num
13205             rev["%s" % num] = revval * 10
13206 >       item.commit()
13207 
13208 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:84]
13209 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13210 
13211     def commit(self):
13212         """
13213             @see: Backend._commit_item.__doc__
13214             """
13215         assert self._uncommitted_revision is not None
13216 >       self._backend._commit_item(self._uncommitted_revision)
13217 
13218 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
13219 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13220 
13221     def _commit_item(self, revision, second_parent=None):
13222         """
13223             Commit given Item Revision to repository. Update and commit Item index file.
13224             If Revision already exists, raise RevisionAlreadyExistsError.
13225             """
13226         item = revision.item
13227         lock = self._lock_repo() #XXX: lock item only!
13228         try:
13229             if not item._id:
13230                 self._add_item(item)
13231             elif revision.revno in self._list_revisions(item):
13232                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
13233     
13234             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
13235             if revision.revno > 0:
13236                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
13237                 if second_parent:
13238                     parents.append(second_parent)
13239             else:
13240                 self._open_item_index(item, 'wb').close()
13241                 self._repo.add([item._id, "%s.rev" % item._id])
13242                 parents = []
13243             internal_meta = {'rev': revision.revno,
13244                              'name': item.name,
13245                              'id': item._id,
13246                              'parents': " ".join(parents)}
13247             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
13248             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
13249     
13250             if not revision.timestamp:
13251                 revision.timestamp = long(time.time())
13252             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
13253             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
13254             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
13255             try:
13256                 match = mercurial.match.exact(self._rev_path, '', [item._id])
13257 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
13258 
13259 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
13260 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13261 
13262     def commit(self, files=None, text="", user=None, date=None,
13263                match=None, force=False, force_editor=False,
13264                p1=None, p2=None, extra={}, empty_ok=False):
13265         wlock = lock = None
13266         if extra.get("close"):
13267             force = True
13268         if files:
13269             files = util.unique(files)
13270         try:
13271             wlock = self.wlock()
13272             lock = self.lock()
13273             use_dirstate = (p1 is None) # not rawcommit
13274     
13275             if use_dirstate:
13276                 p1, p2 = self.dirstate.parents()
13277                 update_dirstate = True
13278     
13279                 if (not force and p2 != nullid and
13280                     (match and (match.files() or match.anypats()))):
13281                     raise util.Abort(_('cannot partially commit a merge '
13282                                        '(do not specify files or patterns)'))
13283     
13284                 if files:
13285                     modified, removed = [], []
13286                     for f in files:
13287                         s = self.dirstate[f]
13288                         if s in 'nma':
13289                             modified.append(f)
13290                         elif s == 'r':
13291                             removed.append(f)
13292                         else:
13293                             self.ui.warn(_("%s not tracked!\n") % f)
13294                     changes = [modified, [], removed, [], []]
13295                 else:
13296                     changes = self.status(match=match)
13297             else:
13298                 p1, p2 = p1, p2 or nullid
13299                 update_dirstate = (self.dirstate.parents()[0] == p1)
13300                 changes = [files, [], [], [], []]
13301     
13302             ms = merge_.mergestate(self)
13303             for f in changes[0]:
13304                 if f in ms and ms[f] == 'u':
13305                     raise util.Abort(_("unresolved merge conflicts "
13306                                                     "(see hg resolve)"))
13307             wctx = context.workingctx(self, (p1, p2), text, user, date,
13308                                       extra, changes)
13309             r = self._commitctx(wctx, force, force_editor, empty_ok,
13310 >                               use_dirstate, update_dirstate)
13311 
13312 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
13313 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13314 
13315     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
13316                   use_dirstate=True, update_dirstate=True):
13317         tr = None
13318         valid = 0 # don't save the dirstate if this isn't set
13319         try:
13320             commit = util.sort(wctx.modified() + wctx.added())
13321             remove = wctx.removed()
13322             extra = wctx.extra().copy()
13323             branchname = extra['branch']
13324             user = wctx.user()
13325             text = wctx.description()
13326     
13327             p1, p2 = [p.node() for p in wctx.parents()]
13328             c1 = self.changelog.read(p1)
13329             c2 = self.changelog.read(p2)
13330             m1 = self.manifest.read(c1[0]).copy()
13331             m2 = self.manifest.read(c2[0])
13332     
13333             if use_dirstate:
13334                 oldname = c1[5].get("branch") # stored in UTF-8
13335                 if (not commit and not remove and not force and p2 == nullid
13336                     and branchname == oldname):
13337                     self.ui.status(_("nothing changed\n"))
13338                     return None
13339     
13340             xp1 = hex(p1)
13341             if p2 == nullid: xp2 = ''
13342             else: xp2 = hex(p2)
13343     
13344             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
13345     
13346             tr = self.transaction()
13347             trp = weakref.proxy(tr)
13348     
13349             # check in files
13350             new = {}
13351             changed = []
13352             linkrev = len(self)
13353             for f in commit:
13354                 self.ui.note(f + "\n")
13355                 try:
13356                     fctx = wctx.filectx(f)
13357                     newflags = fctx.flags()
13358                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
13359                     if ((not changed or changed[-1] != f) and
13360                         m2.get(f) != new[f]):
13361                         # mention the file in the changelog if some
13362                         # flag changed, even if there was no content
13363                         # change.
13364                         if m1.flags(f) != newflags:
13365                             changed.append(f)
13366                     m1.set(f, newflags)
13367                     if use_dirstate:
13368                         self.dirstate.normal(f)
13369     
13370                 except (OSError, IOError):
13371                     if use_dirstate:
13372                         self.ui.warn(_("trouble committing %s!\n") % f)
13373                         raise
13374                     else:
13375                         remove.append(f)
13376     
13377             updated, added = [], []
13378             for f in util.sort(changed):
13379                 if f in m1 or f in m2:
13380                     updated.append(f)
13381                 else:
13382                     added.append(f)
13383     
13384             # update manifest
13385             m1.update(new)
13386             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
13387             removed1 = []
13388     
13389             for f in removed:
13390                 if f in m1:
13391                     del m1[f]
13392                     removed1.append(f)
13393             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
13394                                    (new, removed1))
13395     
13396             # add changeset
13397             if (not empty_ok and not text) or force_editor:
13398                 edittext = []
13399                 if text:
13400                     edittext.append(text)
13401                 edittext.append("")
13402                 edittext.append("") # Empty line between message and comments.
13403                 edittext.append(_("HG: Enter commit message."
13404                                   "  Lines beginning with 'HG:' are removed."))
13405                 edittext.append("HG: --")
13406                 edittext.append("HG: user: %s" % user)
13407                 if p2 != nullid:
13408                     edittext.append("HG: branch merge")
13409                 if branchname:
13410                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
13411                 edittext.extend(["HG: added %s" % f for f in added])
13412                 edittext.extend(["HG: changed %s" % f for f in updated])
13413                 edittext.extend(["HG: removed %s" % f for f in removed])
13414                 if not added and not updated and not removed:
13415                     edittext.append("HG: no files changed")
13416                 edittext.append("")
13417                 # run editor in the repository root
13418 E               olddir = os.getcwd()
13419 >               OSError: [Errno 2] No such file or directory
13420 
13421 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
13422 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
13423 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
13424 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
13425 HG: --
13426 HG: user: nobody
13427 HG: branch 'default'
13428 HG: added ab56b4d92b40713acc5af89985d4b786
13429 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
13430 Vim: Beendet.
13431 ]2;Terminal - Terminal]1;Terminal - Terminal
13432 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
13433 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
13434 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
13435 
13436 transaction abort!
13437 rollback completed
13438 transaction abort!
13439 rollback completed
13440 
13441 - - - - - - - - -  test_large_revision_meta: recorded stderr - - - - - - - - - -
13442 transaction abort!
13443 rollback completed
13444 
13445 ________________________________________________________________________________
13446 __________ entrypoint: TestMercurialBackend().test_data_after_rename ___________
13447 
13448     def test_data_after_rename(self):
13449         item = self.backend.create_item('before')
13450         rev = item.create_revision(0)
13451         rev.write("aaa")
13452 >       item.commit()
13453 
13454 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:96]
13455 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13456 
13457     def commit(self):
13458         """
13459             @see: Backend._commit_item.__doc__
13460             """
13461         assert self._uncommitted_revision is not None
13462 >       self._backend._commit_item(self._uncommitted_revision)
13463 
13464 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
13465 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13466 
13467     def _commit_item(self, revision, second_parent=None):
13468         """
13469             Commit given Item Revision to repository. Update and commit Item index file.
13470             If Revision already exists, raise RevisionAlreadyExistsError.
13471             """
13472         item = revision.item
13473         lock = self._lock_repo() #XXX: lock item only!
13474         try:
13475             if not item._id:
13476                 self._add_item(item)
13477             elif revision.revno in self._list_revisions(item):
13478                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
13479     
13480             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
13481             if revision.revno > 0:
13482                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
13483                 if second_parent:
13484                     parents.append(second_parent)
13485             else:
13486                 self._open_item_index(item, 'wb').close()
13487                 self._repo.add([item._id, "%s.rev" % item._id])
13488                 parents = []
13489             internal_meta = {'rev': revision.revno,
13490                              'name': item.name,
13491                              'id': item._id,
13492                              'parents': " ".join(parents)}
13493             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
13494             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
13495     
13496             if not revision.timestamp:
13497                 revision.timestamp = long(time.time())
13498             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
13499             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
13500             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
13501             try:
13502                 match = mercurial.match.exact(self._rev_path, '', [item._id])
13503 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
13504 
13505 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
13506 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13507 
13508     def commit(self, files=None, text="", user=None, date=None,
13509                match=None, force=False, force_editor=False,
13510                p1=None, p2=None, extra={}, empty_ok=False):
13511         wlock = lock = None
13512         if extra.get("close"):
13513             force = True
13514         if files:
13515             files = util.unique(files)
13516         try:
13517             wlock = self.wlock()
13518             lock = self.lock()
13519             use_dirstate = (p1 is None) # not rawcommit
13520     
13521             if use_dirstate:
13522                 p1, p2 = self.dirstate.parents()
13523                 update_dirstate = True
13524     
13525                 if (not force and p2 != nullid and
13526                     (match and (match.files() or match.anypats()))):
13527                     raise util.Abort(_('cannot partially commit a merge '
13528                                        '(do not specify files or patterns)'))
13529     
13530                 if files:
13531                     modified, removed = [], []
13532                     for f in files:
13533                         s = self.dirstate[f]
13534                         if s in 'nma':
13535                             modified.append(f)
13536                         elif s == 'r':
13537                             removed.append(f)
13538                         else:
13539                             self.ui.warn(_("%s not tracked!\n") % f)
13540                     changes = [modified, [], removed, [], []]
13541                 else:
13542                     changes = self.status(match=match)
13543             else:
13544                 p1, p2 = p1, p2 or nullid
13545                 update_dirstate = (self.dirstate.parents()[0] == p1)
13546                 changes = [files, [], [], [], []]
13547     
13548             ms = merge_.mergestate(self)
13549             for f in changes[0]:
13550                 if f in ms and ms[f] == 'u':
13551                     raise util.Abort(_("unresolved merge conflicts "
13552                                                     "(see hg resolve)"))
13553             wctx = context.workingctx(self, (p1, p2), text, user, date,
13554                                       extra, changes)
13555             r = self._commitctx(wctx, force, force_editor, empty_ok,
13556 >                               use_dirstate, update_dirstate)
13557 
13558 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
13559 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13560 
13561     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
13562                   use_dirstate=True, update_dirstate=True):
13563         tr = None
13564         valid = 0 # don't save the dirstate if this isn't set
13565         try:
13566             commit = util.sort(wctx.modified() + wctx.added())
13567             remove = wctx.removed()
13568             extra = wctx.extra().copy()
13569             branchname = extra['branch']
13570             user = wctx.user()
13571             text = wctx.description()
13572     
13573             p1, p2 = [p.node() for p in wctx.parents()]
13574             c1 = self.changelog.read(p1)
13575             c2 = self.changelog.read(p2)
13576             m1 = self.manifest.read(c1[0]).copy()
13577             m2 = self.manifest.read(c2[0])
13578     
13579             if use_dirstate:
13580                 oldname = c1[5].get("branch") # stored in UTF-8
13581                 if (not commit and not remove and not force and p2 == nullid
13582                     and branchname == oldname):
13583                     self.ui.status(_("nothing changed\n"))
13584                     return None
13585     
13586             xp1 = hex(p1)
13587             if p2 == nullid: xp2 = ''
13588             else: xp2 = hex(p2)
13589     
13590             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
13591     
13592             tr = self.transaction()
13593             trp = weakref.proxy(tr)
13594     
13595             # check in files
13596             new = {}
13597             changed = []
13598             linkrev = len(self)
13599             for f in commit:
13600                 self.ui.note(f + "\n")
13601                 try:
13602                     fctx = wctx.filectx(f)
13603                     newflags = fctx.flags()
13604                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
13605                     if ((not changed or changed[-1] != f) and
13606                         m2.get(f) != new[f]):
13607                         # mention the file in the changelog if some
13608                         # flag changed, even if there was no content
13609                         # change.
13610                         if m1.flags(f) != newflags:
13611                             changed.append(f)
13612                     m1.set(f, newflags)
13613                     if use_dirstate:
13614                         self.dirstate.normal(f)
13615     
13616                 except (OSError, IOError):
13617                     if use_dirstate:
13618                         self.ui.warn(_("trouble committing %s!\n") % f)
13619                         raise
13620                     else:
13621                         remove.append(f)
13622     
13623             updated, added = [], []
13624             for f in util.sort(changed):
13625                 if f in m1 or f in m2:
13626                     updated.append(f)
13627                 else:
13628                     added.append(f)
13629     
13630             # update manifest
13631             m1.update(new)
13632             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
13633             removed1 = []
13634     
13635             for f in removed:
13636                 if f in m1:
13637                     del m1[f]
13638                     removed1.append(f)
13639             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
13640                                    (new, removed1))
13641     
13642             # add changeset
13643             if (not empty_ok and not text) or force_editor:
13644                 edittext = []
13645                 if text:
13646                     edittext.append(text)
13647                 edittext.append("")
13648                 edittext.append("") # Empty line between message and comments.
13649                 edittext.append(_("HG: Enter commit message."
13650                                   "  Lines beginning with 'HG:' are removed."))
13651                 edittext.append("HG: --")
13652                 edittext.append("HG: user: %s" % user)
13653                 if p2 != nullid:
13654                     edittext.append("HG: branch merge")
13655                 if branchname:
13656                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
13657                 edittext.extend(["HG: added %s" % f for f in added])
13658                 edittext.extend(["HG: changed %s" % f for f in updated])
13659                 edittext.extend(["HG: removed %s" % f for f in removed])
13660                 if not added and not updated and not removed:
13661                     edittext.append("HG: no files changed")
13662                 edittext.append("")
13663                 # run editor in the repository root
13664 E               olddir = os.getcwd()
13665 >               OSError: [Errno 2] No such file or directory
13666 
13667 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
13668 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
13669 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
13670 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
13671 HG: --
13672 HG: user: nobody
13673 HG: branch 'default'
13674 HG: added ab56b4d92b40713acc5af89985d4b786
13675 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
13676 Vim: Beendet.
13677 ]2;Terminal - Terminal]1;Terminal - Terminal
13678 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
13679 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
13680 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
13681 
13682 transaction abort!
13683 rollback completed
13684 transaction abort!
13685 rollback completed
13686 
13687 - - - - - - - - -  test_data_after_rename: recorded stderr - - - - - - - - - -
13688 transaction abort!
13689 rollback completed
13690 
13691 ________________________________________________________________________________
13692 ______ entrypoint: TestMercurialBackend().test_revision_metadata_key_name ______
13693 
13694     def test_revision_metadata_key_name(self):
13695         item = self.backend.create_item('metakey')
13696         rev = item.create_revision(0)
13697         rev['_meta_'] = "dummy"
13698 >       item.commit()
13699 
13700 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/_tests/test_backends_hg.py:110]
13701 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13702 
13703     def commit(self):
13704         """
13705             @see: Backend._commit_item.__doc__
13706             """
13707         assert self._uncommitted_revision is not None
13708 >       self._backend._commit_item(self._uncommitted_revision)
13709 
13710 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/__init__.py:749]
13711 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13712 
13713     def _commit_item(self, revision, second_parent=None):
13714         """
13715             Commit given Item Revision to repository. Update and commit Item index file.
13716             If Revision already exists, raise RevisionAlreadyExistsError.
13717             """
13718         item = revision.item
13719         lock = self._lock_repo() #XXX: lock item only!
13720         try:
13721             if not item._id:
13722                 self._add_item(item)
13723             elif revision.revno in self._list_revisions(item):
13724                 raise RevisionAlreadyExistsError("Item Revision already exists: %s" % revision.revno)
13725     
13726             util.rename(revision._tmp_fpath, os.path.join(self._rev_path, item._id))
13727             if revision.revno > 0:
13728                 parents = [self._get_changectx(self._get_revision(item, revision.revno - 1)).node()]
13729                 if second_parent:
13730                     parents.append(second_parent)
13731             else:
13732                 self._open_item_index(item, 'wb').close()
13733                 self._repo.add([item._id, "%s.rev" % item._id])
13734                 parents = []
13735             internal_meta = {'rev': revision.revno,
13736                              'name': item.name,
13737                              'id': item._id,
13738                              'parents': " ".join(parents)}
13739             meta = self._encode_metadata(internal_meta, BACKEND_METADATA_PREFIX)
13740             meta.update(self._encode_metadata(revision, WIKI_METADATA_PREFIX))
13741     
13742             if not revision.timestamp:
13743                 revision.timestamp = long(time.time())
13744             date = datetime.fromtimestamp(revision.timestamp).isoformat(sep=' ')
13745             user = revision.get(EDIT_LOG_USERID, DEFAULT_USER).encode("utf-8")
13746             msg = revision.get(EDIT_LOG_COMMENT, '').encode("utf-8")
13747             try:
13748                 match = mercurial.match.exact(self._rev_path, '', [item._id])
13749 >               self._repo.commit(match=match, text=msg, user=user, date=date, extra=meta, force=True)
13750 
13751 [/home/user/workspace/moin-2.0-storage/MoinMoin/storage/backends/hg.py:325]
13752 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13753 
13754     def commit(self, files=None, text="", user=None, date=None,
13755                match=None, force=False, force_editor=False,
13756                p1=None, p2=None, extra={}, empty_ok=False):
13757         wlock = lock = None
13758         if extra.get("close"):
13759             force = True
13760         if files:
13761             files = util.unique(files)
13762         try:
13763             wlock = self.wlock()
13764             lock = self.lock()
13765             use_dirstate = (p1 is None) # not rawcommit
13766     
13767             if use_dirstate:
13768                 p1, p2 = self.dirstate.parents()
13769                 update_dirstate = True
13770     
13771                 if (not force and p2 != nullid and
13772                     (match and (match.files() or match.anypats()))):
13773                     raise util.Abort(_('cannot partially commit a merge '
13774                                        '(do not specify files or patterns)'))
13775     
13776                 if files:
13777                     modified, removed = [], []
13778                     for f in files:
13779                         s = self.dirstate[f]
13780                         if s in 'nma':
13781                             modified.append(f)
13782                         elif s == 'r':
13783                             removed.append(f)
13784                         else:
13785                             self.ui.warn(_("%s not tracked!\n") % f)
13786                     changes = [modified, [], removed, [], []]
13787                 else:
13788                     changes = self.status(match=match)
13789             else:
13790                 p1, p2 = p1, p2 or nullid
13791                 update_dirstate = (self.dirstate.parents()[0] == p1)
13792                 changes = [files, [], [], [], []]
13793     
13794             ms = merge_.mergestate(self)
13795             for f in changes[0]:
13796                 if f in ms and ms[f] == 'u':
13797                     raise util.Abort(_("unresolved merge conflicts "
13798                                                     "(see hg resolve)"))
13799             wctx = context.workingctx(self, (p1, p2), text, user, date,
13800                                       extra, changes)
13801             r = self._commitctx(wctx, force, force_editor, empty_ok,
13802 >                               use_dirstate, update_dirstate)
13803 
13804 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:828]
13805 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13806 
13807     def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False,
13808                   use_dirstate=True, update_dirstate=True):
13809         tr = None
13810         valid = 0 # don't save the dirstate if this isn't set
13811         try:
13812             commit = util.sort(wctx.modified() + wctx.added())
13813             remove = wctx.removed()
13814             extra = wctx.extra().copy()
13815             branchname = extra['branch']
13816             user = wctx.user()
13817             text = wctx.description()
13818     
13819             p1, p2 = [p.node() for p in wctx.parents()]
13820             c1 = self.changelog.read(p1)
13821             c2 = self.changelog.read(p2)
13822             m1 = self.manifest.read(c1[0]).copy()
13823             m2 = self.manifest.read(c2[0])
13824     
13825             if use_dirstate:
13826                 oldname = c1[5].get("branch") # stored in UTF-8
13827                 if (not commit and not remove and not force and p2 == nullid
13828                     and branchname == oldname):
13829                     self.ui.status(_("nothing changed\n"))
13830                     return None
13831     
13832             xp1 = hex(p1)
13833             if p2 == nullid: xp2 = ''
13834             else: xp2 = hex(p2)
13835     
13836             self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
13837     
13838             tr = self.transaction()
13839             trp = weakref.proxy(tr)
13840     
13841             # check in files
13842             new = {}
13843             changed = []
13844             linkrev = len(self)
13845             for f in commit:
13846                 self.ui.note(f + "\n")
13847                 try:
13848                     fctx = wctx.filectx(f)
13849                     newflags = fctx.flags()
13850                     new[f] = self.filecommit(fctx, m1, m2, linkrev, trp, changed)
13851                     if ((not changed or changed[-1] != f) and
13852                         m2.get(f) != new[f]):
13853                         # mention the file in the changelog if some
13854                         # flag changed, even if there was no content
13855                         # change.
13856                         if m1.flags(f) != newflags:
13857                             changed.append(f)
13858                     m1.set(f, newflags)
13859                     if use_dirstate:
13860                         self.dirstate.normal(f)
13861     
13862                 except (OSError, IOError):
13863                     if use_dirstate:
13864                         self.ui.warn(_("trouble committing %s!\n") % f)
13865                         raise
13866                     else:
13867                         remove.append(f)
13868     
13869             updated, added = [], []
13870             for f in util.sort(changed):
13871                 if f in m1 or f in m2:
13872                     updated.append(f)
13873                 else:
13874                     added.append(f)
13875     
13876             # update manifest
13877             m1.update(new)
13878             removed = [f for f in util.sort(remove) if f in m1 or f in m2]
13879             removed1 = []
13880     
13881             for f in removed:
13882                 if f in m1:
13883                     del m1[f]
13884                     removed1.append(f)
13885             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
13886                                    (new, removed1))
13887     
13888             # add changeset
13889             if (not empty_ok and not text) or force_editor:
13890                 edittext = []
13891                 if text:
13892                     edittext.append(text)
13893                 edittext.append("")
13894                 edittext.append("") # Empty line between message and comments.
13895                 edittext.append(_("HG: Enter commit message."
13896                                   "  Lines beginning with 'HG:' are removed."))
13897                 edittext.append("HG: --")
13898                 edittext.append("HG: user: %s" % user)
13899                 if p2 != nullid:
13900                     edittext.append("HG: branch merge")
13901                 if branchname:
13902                     edittext.append("HG: branch '%s'" % util.tolocal(branchname))
13903                 edittext.extend(["HG: added %s" % f for f in added])
13904                 edittext.extend(["HG: changed %s" % f for f in updated])
13905                 edittext.extend(["HG: removed %s" % f for f in removed])
13906                 if not added and not updated and not removed:
13907                     edittext.append("HG: no files changed")
13908                 edittext.append("")
13909                 # run editor in the repository root
13910 E               olddir = os.getcwd()
13911 >               OSError: [Errno 2] No such file or directory
13912 
13913 [/usr/local/lib/python2.6/dist-packages/mercurial-unknown-py2.6-linux-x86_64.egg/mercurial/localrepo.py:954]
13914 - - - - - - - - - -  test_backends_hg.py: recorded stdout - - - - - - - - - - -
13915 [?1049h[?1h=[?12;25h[?12l[?25h[?25l"/tmp/hg-editor-qpay2L.txt" 
13916 "/tmp/hg-editor-qpay2L.txt" 7L, 157CHG: Enter commit message.  Lines beginning with 'HG:' are removed.
13917 HG: --
13918 HG: user: nobody
13919 HG: branch 'default'
13920 HG: added ab56b4d92b40713acc5af89985d4b786
13921 ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               ~                                                                               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...
13922 Vim: Beendet.
13923 ]2;Terminal - Terminal]1;Terminal - Terminal
13924 - - - - - - - - - -  test_backends_hg.py: recorded stderr - - - - - - - - - - -
13925 Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal
13926 Vim: Warnung: Die Eingabe kommt nicht von einem Terminal
13927 
13928 transaction abort!
13929 rollback completed
13930 transaction abort!
13931 rollback completed
13932 
13933 - - - - - - -  test_revision_metadata_key_name: recorded stderr - - - - - - - -
13934 transaction abort!
13935 rollback completed
13936 
13937 ________________________________________________________________________________
13938 _________________________________ entrypoint:  _________________________________
13939 
13940     def runtraced(self, colitem):
13941         if self.shouldclose(): 
13942             raise Exit, "received external close signal" 
13943     
13944         outcome = None 
13945         colitem.startcapture() 
13946         try: 
13947             self.start(colitem)
13948             try: 
13949                 try:
13950                     if colitem._stickyfailure: 
13951                         raise colitem._stickyfailure 
13952 >                   outcome = self.run(colitem) 
13953 
13954 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
13955 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13956 
13957     def run(self, colitem): 
13958         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
13959             return 
13960         if isinstance(colitem, py.test.collect.Item): 
13961             colitem._skipbykeyword(self.config.option.keyword)
13962         res = colitem.run() 
13963         if res is None: 
13964             return Passed() 
13965         elif not isinstance(res, (list, tuple)): 
13966             raise TypeError("%r.run() returned neither "
13967                             "list, tuple nor None: %r" % (colitem, res))
13968         else: 
13969             finish = self.startiteration(colitem, res)
13970             try: 
13971                 for name in res: 
13972                     obj = colitem.join(name) 
13973                     assert obj is not None 
13974 >                   self.runtraced(obj) 
13975 
13976 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
13977 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13978 
13979     def runtraced(self, colitem):
13980         if self.shouldclose(): 
13981             raise Exit, "received external close signal" 
13982     
13983         outcome = None 
13984         colitem.startcapture() 
13985         try: 
13986 >           self.start(colitem)
13987 
13988 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
13989 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
13990 
13991     def start(self, colitem):
13992         super(TerminalSession, self).start(colitem) 
13993         if self.config.option.collectonly: 
13994             cols = self._opencollectors
13995             self.out.line('    ' * len(cols) + repr(colitem))
13996             cols.append(colitem) 
13997         else: 
13998             cls = getattr(colitem, '__class__', None)
13999             if cls is None:
14000                 return
14001             for typ in py.std.inspect.getmro(cls):
14002                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14003                 if meth:
14004 >                   meth(colitem)
14005 
14006 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14007 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14008 
14009     def start_Module(self, colitem): 
14010         if self.config.option.verbose == 0: 
14011 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14012 
14013 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14014 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14015 
14016     def __new__(cls, path=None):
14017         """ Initialize and return a local Path instance.
14018     
14019             Path can be relative to the current directory.
14020             If it is None then the current working directory is taken.
14021             Note that Path instances always carry an absolute path.
14022             Note also that passing in a local path object will simply return
14023             the exact same path object. Use new() to get a new copy.
14024             """
14025         if isinstance(path, common.FSPathBase):
14026             if path.__class__ == cls:
14027                 return path
14028             path = path.strpath
14029         # initialize the path
14030         self = object.__new__(cls)
14031         if not path:
14032             self.strpath = os.getcwd()
14033         elif isinstance(path, str):
14034 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14035 
14036 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14037 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14038 
14039     def abspath(path):
14040         """Return an absolute path."""
14041         if not isabs(path):
14042 E           path = join(os.getcwd(), path)
14043 >           OSError: [Errno 2] No such file or directory
14044 
14045 [/usr/lib/python2.6/posixpath.py:337]
14046 ________________________________________________________________________________
14047 _________________________________ entrypoint:  _________________________________
14048 
14049     def runtraced(self, colitem):
14050         if self.shouldclose(): 
14051             raise Exit, "received external close signal" 
14052     
14053         outcome = None 
14054         colitem.startcapture() 
14055         try: 
14056             self.start(colitem)
14057             try: 
14058                 try:
14059                     if colitem._stickyfailure: 
14060                         raise colitem._stickyfailure 
14061 >                   outcome = self.run(colitem) 
14062 
14063 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14064 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14065 
14066     def run(self, colitem): 
14067         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14068             return 
14069         if isinstance(colitem, py.test.collect.Item): 
14070             colitem._skipbykeyword(self.config.option.keyword)
14071         res = colitem.run() 
14072         if res is None: 
14073             return Passed() 
14074         elif not isinstance(res, (list, tuple)): 
14075             raise TypeError("%r.run() returned neither "
14076                             "list, tuple nor None: %r" % (colitem, res))
14077         else: 
14078             finish = self.startiteration(colitem, res)
14079             try: 
14080                 for name in res: 
14081                     obj = colitem.join(name) 
14082                     assert obj is not None 
14083 >                   self.runtraced(obj) 
14084 
14085 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14086 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14087 
14088     def runtraced(self, colitem):
14089         if self.shouldclose(): 
14090             raise Exit, "received external close signal" 
14091     
14092         outcome = None 
14093         colitem.startcapture() 
14094         try: 
14095 >           self.start(colitem)
14096 
14097 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14098 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14099 
14100     def start(self, colitem):
14101         super(TerminalSession, self).start(colitem) 
14102         if self.config.option.collectonly: 
14103             cols = self._opencollectors
14104             self.out.line('    ' * len(cols) + repr(colitem))
14105             cols.append(colitem) 
14106         else: 
14107             cls = getattr(colitem, '__class__', None)
14108             if cls is None:
14109                 return
14110             for typ in py.std.inspect.getmro(cls):
14111                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14112                 if meth:
14113 >                   meth(colitem)
14114 
14115 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14116 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14117 
14118     def start_Module(self, colitem): 
14119         if self.config.option.verbose == 0: 
14120 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14121 
14122 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14123 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14124 
14125     def __new__(cls, path=None):
14126         """ Initialize and return a local Path instance.
14127     
14128             Path can be relative to the current directory.
14129             If it is None then the current working directory is taken.
14130             Note that Path instances always carry an absolute path.
14131             Note also that passing in a local path object will simply return
14132             the exact same path object. Use new() to get a new copy.
14133             """
14134         if isinstance(path, common.FSPathBase):
14135             if path.__class__ == cls:
14136                 return path
14137             path = path.strpath
14138         # initialize the path
14139         self = object.__new__(cls)
14140         if not path:
14141             self.strpath = os.getcwd()
14142         elif isinstance(path, str):
14143 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14144 
14145 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14146 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14147 
14148     def abspath(path):
14149         """Return an absolute path."""
14150         if not isabs(path):
14151 E           path = join(os.getcwd(), path)
14152 >           OSError: [Errno 2] No such file or directory
14153 
14154 [/usr/lib/python2.6/posixpath.py:337]
14155 ________________________________________________________________________________
14156 _________________________________ entrypoint:  _________________________________
14157 
14158     def runtraced(self, colitem):
14159         if self.shouldclose(): 
14160             raise Exit, "received external close signal" 
14161     
14162         outcome = None 
14163         colitem.startcapture() 
14164         try: 
14165             self.start(colitem)
14166             try: 
14167                 try:
14168                     if colitem._stickyfailure: 
14169                         raise colitem._stickyfailure 
14170 >                   outcome = self.run(colitem) 
14171 
14172 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14173 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14174 
14175     def run(self, colitem): 
14176         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14177             return 
14178         if isinstance(colitem, py.test.collect.Item): 
14179             colitem._skipbykeyword(self.config.option.keyword)
14180         res = colitem.run() 
14181         if res is None: 
14182             return Passed() 
14183         elif not isinstance(res, (list, tuple)): 
14184             raise TypeError("%r.run() returned neither "
14185                             "list, tuple nor None: %r" % (colitem, res))
14186         else: 
14187             finish = self.startiteration(colitem, res)
14188             try: 
14189                 for name in res: 
14190                     obj = colitem.join(name) 
14191                     assert obj is not None 
14192 >                   self.runtraced(obj) 
14193 
14194 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14195 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14196 
14197     def runtraced(self, colitem):
14198         if self.shouldclose(): 
14199             raise Exit, "received external close signal" 
14200     
14201         outcome = None 
14202         colitem.startcapture() 
14203         try: 
14204 >           self.start(colitem)
14205 
14206 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14207 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14208 
14209     def start(self, colitem):
14210         super(TerminalSession, self).start(colitem) 
14211         if self.config.option.collectonly: 
14212             cols = self._opencollectors
14213             self.out.line('    ' * len(cols) + repr(colitem))
14214             cols.append(colitem) 
14215         else: 
14216             cls = getattr(colitem, '__class__', None)
14217             if cls is None:
14218                 return
14219             for typ in py.std.inspect.getmro(cls):
14220                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14221                 if meth:
14222 >                   meth(colitem)
14223 
14224 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14225 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14226 
14227     def start_Module(self, colitem): 
14228         if self.config.option.verbose == 0: 
14229 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14230 
14231 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14232 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14233 
14234     def __new__(cls, path=None):
14235         """ Initialize and return a local Path instance.
14236     
14237             Path can be relative to the current directory.
14238             If it is None then the current working directory is taken.
14239             Note that Path instances always carry an absolute path.
14240             Note also that passing in a local path object will simply return
14241             the exact same path object. Use new() to get a new copy.
14242             """
14243         if isinstance(path, common.FSPathBase):
14244             if path.__class__ == cls:
14245                 return path
14246             path = path.strpath
14247         # initialize the path
14248         self = object.__new__(cls)
14249         if not path:
14250             self.strpath = os.getcwd()
14251         elif isinstance(path, str):
14252 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14253 
14254 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14255 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14256 
14257     def abspath(path):
14258         """Return an absolute path."""
14259         if not isabs(path):
14260 E           path = join(os.getcwd(), path)
14261 >           OSError: [Errno 2] No such file or directory
14262 
14263 [/usr/lib/python2.6/posixpath.py:337]
14264 ________________________________________________________________________________
14265 _________________________________ entrypoint:  _________________________________
14266 
14267     def runtraced(self, colitem):
14268         if self.shouldclose(): 
14269             raise Exit, "received external close signal" 
14270     
14271         outcome = None 
14272         colitem.startcapture() 
14273         try: 
14274             self.start(colitem)
14275             try: 
14276                 try:
14277                     if colitem._stickyfailure: 
14278                         raise colitem._stickyfailure 
14279 >                   outcome = self.run(colitem) 
14280 
14281 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14282 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14283 
14284     def run(self, colitem): 
14285         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14286             return 
14287         if isinstance(colitem, py.test.collect.Item): 
14288             colitem._skipbykeyword(self.config.option.keyword)
14289         res = colitem.run() 
14290         if res is None: 
14291             return Passed() 
14292         elif not isinstance(res, (list, tuple)): 
14293             raise TypeError("%r.run() returned neither "
14294                             "list, tuple nor None: %r" % (colitem, res))
14295         else: 
14296             finish = self.startiteration(colitem, res)
14297             try: 
14298                 for name in res: 
14299                     obj = colitem.join(name) 
14300                     assert obj is not None 
14301 >                   self.runtraced(obj) 
14302 
14303 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14304 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14305 
14306     def runtraced(self, colitem):
14307         if self.shouldclose(): 
14308             raise Exit, "received external close signal" 
14309     
14310         outcome = None 
14311         colitem.startcapture() 
14312         try: 
14313 >           self.start(colitem)
14314 
14315 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14316 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14317 
14318     def start(self, colitem):
14319         super(TerminalSession, self).start(colitem) 
14320         if self.config.option.collectonly: 
14321             cols = self._opencollectors
14322             self.out.line('    ' * len(cols) + repr(colitem))
14323             cols.append(colitem) 
14324         else: 
14325             cls = getattr(colitem, '__class__', None)
14326             if cls is None:
14327                 return
14328             for typ in py.std.inspect.getmro(cls):
14329                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14330                 if meth:
14331 >                   meth(colitem)
14332 
14333 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14334 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14335 
14336     def start_Module(self, colitem): 
14337         if self.config.option.verbose == 0: 
14338 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14339 
14340 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14341 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14342 
14343     def __new__(cls, path=None):
14344         """ Initialize and return a local Path instance.
14345     
14346             Path can be relative to the current directory.
14347             If it is None then the current working directory is taken.
14348             Note that Path instances always carry an absolute path.
14349             Note also that passing in a local path object will simply return
14350             the exact same path object. Use new() to get a new copy.
14351             """
14352         if isinstance(path, common.FSPathBase):
14353             if path.__class__ == cls:
14354                 return path
14355             path = path.strpath
14356         # initialize the path
14357         self = object.__new__(cls)
14358         if not path:
14359             self.strpath = os.getcwd()
14360         elif isinstance(path, str):
14361 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14362 
14363 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14364 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14365 
14366     def abspath(path):
14367         """Return an absolute path."""
14368         if not isabs(path):
14369 E           path = join(os.getcwd(), path)
14370 >           OSError: [Errno 2] No such file or directory
14371 
14372 [/usr/lib/python2.6/posixpath.py:337]
14373 ________________________________________________________________________________
14374 _________________________________ entrypoint:  _________________________________
14375 
14376     def runtraced(self, colitem):
14377         if self.shouldclose(): 
14378             raise Exit, "received external close signal" 
14379     
14380         outcome = None 
14381         colitem.startcapture() 
14382         try: 
14383             self.start(colitem)
14384             try: 
14385                 try:
14386                     if colitem._stickyfailure: 
14387                         raise colitem._stickyfailure 
14388 >                   outcome = self.run(colitem) 
14389 
14390 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14391 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14392 
14393     def run(self, colitem): 
14394         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14395             return 
14396         if isinstance(colitem, py.test.collect.Item): 
14397             colitem._skipbykeyword(self.config.option.keyword)
14398         res = colitem.run() 
14399         if res is None: 
14400             return Passed() 
14401         elif not isinstance(res, (list, tuple)): 
14402             raise TypeError("%r.run() returned neither "
14403                             "list, tuple nor None: %r" % (colitem, res))
14404         else: 
14405             finish = self.startiteration(colitem, res)
14406             try: 
14407                 for name in res: 
14408                     obj = colitem.join(name) 
14409                     assert obj is not None 
14410 >                   self.runtraced(obj) 
14411 
14412 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14413 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14414 
14415     def runtraced(self, colitem):
14416         if self.shouldclose(): 
14417             raise Exit, "received external close signal" 
14418     
14419         outcome = None 
14420         colitem.startcapture() 
14421         try: 
14422 >           self.start(colitem)
14423 
14424 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14425 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14426 
14427     def start(self, colitem):
14428         super(TerminalSession, self).start(colitem) 
14429         if self.config.option.collectonly: 
14430             cols = self._opencollectors
14431             self.out.line('    ' * len(cols) + repr(colitem))
14432             cols.append(colitem) 
14433         else: 
14434             cls = getattr(colitem, '__class__', None)
14435             if cls is None:
14436                 return
14437             for typ in py.std.inspect.getmro(cls):
14438                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14439                 if meth:
14440 >                   meth(colitem)
14441 
14442 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14443 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14444 
14445     def start_Module(self, colitem): 
14446         if self.config.option.verbose == 0: 
14447 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14448 
14449 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14450 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14451 
14452     def __new__(cls, path=None):
14453         """ Initialize and return a local Path instance.
14454     
14455             Path can be relative to the current directory.
14456             If it is None then the current working directory is taken.
14457             Note that Path instances always carry an absolute path.
14458             Note also that passing in a local path object will simply return
14459             the exact same path object. Use new() to get a new copy.
14460             """
14461         if isinstance(path, common.FSPathBase):
14462             if path.__class__ == cls:
14463                 return path
14464             path = path.strpath
14465         # initialize the path
14466         self = object.__new__(cls)
14467         if not path:
14468             self.strpath = os.getcwd()
14469         elif isinstance(path, str):
14470 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14471 
14472 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14473 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14474 
14475     def abspath(path):
14476         """Return an absolute path."""
14477         if not isabs(path):
14478 E           path = join(os.getcwd(), path)
14479 >           OSError: [Errno 2] No such file or directory
14480 
14481 [/usr/lib/python2.6/posixpath.py:337]
14482 ________________________________________________________________________________
14483 _________________________________ entrypoint:  _________________________________
14484 
14485     def runtraced(self, colitem):
14486         if self.shouldclose(): 
14487             raise Exit, "received external close signal" 
14488     
14489         outcome = None 
14490         colitem.startcapture() 
14491         try: 
14492             self.start(colitem)
14493             try: 
14494                 try:
14495                     if colitem._stickyfailure: 
14496                         raise colitem._stickyfailure 
14497 >                   outcome = self.run(colitem) 
14498 
14499 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14500 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14501 
14502     def run(self, colitem): 
14503         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14504             return 
14505         if isinstance(colitem, py.test.collect.Item): 
14506             colitem._skipbykeyword(self.config.option.keyword)
14507         res = colitem.run() 
14508         if res is None: 
14509             return Passed() 
14510         elif not isinstance(res, (list, tuple)): 
14511             raise TypeError("%r.run() returned neither "
14512                             "list, tuple nor None: %r" % (colitem, res))
14513         else: 
14514             finish = self.startiteration(colitem, res)
14515             try: 
14516                 for name in res: 
14517                     obj = colitem.join(name) 
14518                     assert obj is not None 
14519 >                   self.runtraced(obj) 
14520 
14521 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14522 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14523 
14524     def runtraced(self, colitem):
14525         if self.shouldclose(): 
14526             raise Exit, "received external close signal" 
14527     
14528         outcome = None 
14529         colitem.startcapture() 
14530         try: 
14531 >           self.start(colitem)
14532 
14533 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14534 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14535 
14536     def start(self, colitem):
14537         super(TerminalSession, self).start(colitem) 
14538         if self.config.option.collectonly: 
14539             cols = self._opencollectors
14540             self.out.line('    ' * len(cols) + repr(colitem))
14541             cols.append(colitem) 
14542         else: 
14543             cls = getattr(colitem, '__class__', None)
14544             if cls is None:
14545                 return
14546             for typ in py.std.inspect.getmro(cls):
14547                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14548                 if meth:
14549 >                   meth(colitem)
14550 
14551 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14552 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14553 
14554     def start_Module(self, colitem): 
14555         if self.config.option.verbose == 0: 
14556 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14557 
14558 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14559 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14560 
14561     def __new__(cls, path=None):
14562         """ Initialize and return a local Path instance.
14563     
14564             Path can be relative to the current directory.
14565             If it is None then the current working directory is taken.
14566             Note that Path instances always carry an absolute path.
14567             Note also that passing in a local path object will simply return
14568             the exact same path object. Use new() to get a new copy.
14569             """
14570         if isinstance(path, common.FSPathBase):
14571             if path.__class__ == cls:
14572                 return path
14573             path = path.strpath
14574         # initialize the path
14575         self = object.__new__(cls)
14576         if not path:
14577             self.strpath = os.getcwd()
14578         elif isinstance(path, str):
14579 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14580 
14581 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14582 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14583 
14584     def abspath(path):
14585         """Return an absolute path."""
14586         if not isabs(path):
14587 E           path = join(os.getcwd(), path)
14588 >           OSError: [Errno 2] No such file or directory
14589 
14590 [/usr/lib/python2.6/posixpath.py:337]
14591 ________________________________________________________________________________
14592 _________________________________ entrypoint:  _________________________________
14593 
14594     def runtraced(self, colitem):
14595         if self.shouldclose(): 
14596             raise Exit, "received external close signal" 
14597     
14598         outcome = None 
14599         colitem.startcapture() 
14600         try: 
14601             self.start(colitem)
14602             try: 
14603                 try:
14604                     if colitem._stickyfailure: 
14605                         raise colitem._stickyfailure 
14606 >                   outcome = self.run(colitem) 
14607 
14608 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14609 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14610 
14611     def run(self, colitem): 
14612         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14613             return 
14614         if isinstance(colitem, py.test.collect.Item): 
14615             colitem._skipbykeyword(self.config.option.keyword)
14616         res = colitem.run() 
14617         if res is None: 
14618             return Passed() 
14619         elif not isinstance(res, (list, tuple)): 
14620             raise TypeError("%r.run() returned neither "
14621                             "list, tuple nor None: %r" % (colitem, res))
14622         else: 
14623             finish = self.startiteration(colitem, res)
14624             try: 
14625                 for name in res: 
14626                     obj = colitem.join(name) 
14627                     assert obj is not None 
14628 >                   self.runtraced(obj) 
14629 
14630 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14631 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14632 
14633     def runtraced(self, colitem):
14634         if self.shouldclose(): 
14635             raise Exit, "received external close signal" 
14636     
14637         outcome = None 
14638         colitem.startcapture() 
14639         try: 
14640 >           self.start(colitem)
14641 
14642 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14643 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14644 
14645     def start(self, colitem):
14646         super(TerminalSession, self).start(colitem) 
14647         if self.config.option.collectonly: 
14648             cols = self._opencollectors
14649             self.out.line('    ' * len(cols) + repr(colitem))
14650             cols.append(colitem) 
14651         else: 
14652             cls = getattr(colitem, '__class__', None)
14653             if cls is None:
14654                 return
14655             for typ in py.std.inspect.getmro(cls):
14656                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14657                 if meth:
14658 >                   meth(colitem)
14659 
14660 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14661 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14662 
14663     def start_Module(self, colitem): 
14664         if self.config.option.verbose == 0: 
14665 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14666 
14667 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14668 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14669 
14670     def __new__(cls, path=None):
14671         """ Initialize and return a local Path instance.
14672     
14673             Path can be relative to the current directory.
14674             If it is None then the current working directory is taken.
14675             Note that Path instances always carry an absolute path.
14676             Note also that passing in a local path object will simply return
14677             the exact same path object. Use new() to get a new copy.
14678             """
14679         if isinstance(path, common.FSPathBase):
14680             if path.__class__ == cls:
14681                 return path
14682             path = path.strpath
14683         # initialize the path
14684         self = object.__new__(cls)
14685         if not path:
14686             self.strpath = os.getcwd()
14687         elif isinstance(path, str):
14688 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14689 
14690 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14691 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14692 
14693     def abspath(path):
14694         """Return an absolute path."""
14695         if not isabs(path):
14696 E           path = join(os.getcwd(), path)
14697 >           OSError: [Errno 2] No such file or directory
14698 
14699 [/usr/lib/python2.6/posixpath.py:337]
14700 ________________________________________________________________________________
14701 _________________________________ entrypoint:  _________________________________
14702 
14703     def runtraced(self, colitem):
14704         if self.shouldclose(): 
14705             raise Exit, "received external close signal" 
14706     
14707         outcome = None 
14708         colitem.startcapture() 
14709         try: 
14710             self.start(colitem)
14711             try: 
14712                 try:
14713                     if colitem._stickyfailure: 
14714                         raise colitem._stickyfailure 
14715 >                   outcome = self.run(colitem) 
14716 
14717 [/usr/lib/python2.6/dist-packages/py/test/session.py:84]
14718 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14719 
14720     def run(self, colitem): 
14721         if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
14722             return 
14723         if isinstance(colitem, py.test.collect.Item): 
14724             colitem._skipbykeyword(self.config.option.keyword)
14725         res = colitem.run() 
14726         if res is None: 
14727             return Passed() 
14728         elif not isinstance(res, (list, tuple)): 
14729             raise TypeError("%r.run() returned neither "
14730                             "list, tuple nor None: %r" % (colitem, res))
14731         else: 
14732             finish = self.startiteration(colitem, res)
14733             try: 
14734                 for name in res: 
14735                     obj = colitem.join(name) 
14736                     assert obj is not None 
14737 >                   self.runtraced(obj) 
14738 
14739 [/usr/lib/python2.6/dist-packages/py/test/session.py:119]
14740 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14741 
14742     def runtraced(self, colitem):
14743         if self.shouldclose(): 
14744             raise Exit, "received external close signal" 
14745     
14746         outcome = None 
14747         colitem.startcapture() 
14748         try: 
14749 >           self.start(colitem)
14750 
14751 [/usr/lib/python2.6/dist-packages/py/test/session.py:79]
14752 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14753 
14754     def start(self, colitem):
14755         super(TerminalSession, self).start(colitem) 
14756         if self.config.option.collectonly: 
14757             cols = self._opencollectors
14758             self.out.line('    ' * len(cols) + repr(colitem))
14759             cols.append(colitem) 
14760         else: 
14761             cls = getattr(colitem, '__class__', None)
14762             if cls is None:
14763                 return
14764             for typ in py.std.inspect.getmro(cls):
14765                 meth = getattr(self, 'start_%s' % typ.__name__, None)
14766                 if meth:
14767 >                   meth(colitem)
14768 
14769 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:48]
14770 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14771 
14772     def start_Module(self, colitem): 
14773         if self.config.option.verbose == 0: 
14774 >           abbrev_fn = getrelpath(py.path.local('.xxx.'), colitem.fspath)
14775 
14776 [/usr/lib/python2.6/dist-packages/py/test/terminal/terminal.py:54]
14777 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14778 
14779     def __new__(cls, path=None):
14780         """ Initialize and return a local Path instance.
14781     
14782             Path can be relative to the current directory.
14783             If it is None then the current working directory is taken.
14784             Note that Path instances always carry an absolute path.
14785             Note also that passing in a local path object will simply return
14786             the exact same path object. Use new() to get a new copy.
14787             """
14788         if isinstance(path, common.FSPathBase):
14789             if path.__class__ == cls:
14790                 return path
14791             path = path.strpath
14792         # initialize the path
14793         self = object.__new__(cls)
14794         if not path:
14795             self.strpath = os.getcwd()
14796         elif isinstance(path, str):
14797 >           self.strpath = os.path.abspath(os.path.normpath(str(path)))
14798 
14799 [/usr/lib/python2.6/dist-packages/py/path/local/local.py:69]
14800 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
14801 
14802     def abspath(path):
14803         """Return an absolute path."""
14804         if not isabs(path):
14805 E           path = join(os.getcwd(), path)
14806 >           OSError: [Errno 2] No such file or directory
14807 
14808 [/usr/lib/python2.6/posixpath.py:337]
14809 ________________________________________________________________________________
14810 ===== tests finished: 1228 passed, 84 failed, 83 skipped in 31.29 seconds ======

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-06-28 12:08:22, 8.1 KB) [[attachment:ArnicaTestSeite.htm]]
  • [get | view] (2008-05-09 17:05:26, 1.3 KB) [[attachment:AttachFile_config_patch.patch]]
  • [get | view] (2010-11-28 20:20:00, 237.6 KB) [[attachment:Bildschirmfoto.png]]
  • [get | view] (2010-03-15 23:32:08, 1.4 KB) [[attachment:DictColumns.zip]]
  • [get | view] (2012-02-05 12:57:40, 1812.4 KB) [[attachment:HelpOnArnica.zip]]
  • [get | view] (2008-07-17 19:33:36, 3264.0 KB) [[attachment:MoinMoins_GHOP_Grand_Prize_Winner.mpg]]
  • [get | view] (2009-06-22 22:46:07, 490.1 KB) [[attachment:New_street_station_to_Conservatoire_to_premier_inn.png]]
  • [get | view] (2009-06-22 22:59:17, 70.6 KB) [[attachment:New_street_station_to_Conservatoire_to_premier_inn_weg.png]]
  • [get | view] (2009-09-04 11:37:10, 3.4 KB) [[attachment:SlideShow.patch]]
  • [get | view] (2010-02-02 18:27:19, 293.8 KB) [[attachment:Solenoid_svg_edit.png]]
  • [get | view] (2009-04-13 17:51:57, 22.8 KB) [[attachment:SystemPages.png]]
  • [get | view] (2009-04-13 18:58:14, 1.4 KB) [[attachment:SystemPages.py]]
  • [get | view] (2008-10-19 04:19:34, 252.4 KB) [[attachment:TheSheep1.png]]
  • [get | view] (2008-07-28 08:12:08, 685.8 KB) [[attachment:UnderConstruction.zip]]
  • [get | view] (2008-06-28 18:54:51, 7.9 KB) [[attachment:UnifyParsersAndMacros.zip]]
  • [get | view] (2007-06-07 16:02:03, 0.3 KB) [[attachment:abc.png]]
  • [get | view] (2009-09-06 11:39:34, 10.0 KB) [[attachment:abc235.adraw]]
  • [get | view] (2008-12-22 09:09:36, 1.1 KB) [[attachment:advanced_s.patch]]
  • [get | view] (2008-09-15 07:51:42, 2.0 KB) [[attachment:align1.png]]
  • [get | view] (2008-06-24 01:17:08, 255.3 KB) [[attachment:arnica_example1.png]]
  • [get | view] (2008-06-22 19:38:31, 128.2 KB) [[attachment:arnica_example2.png]]
  • [get | view] (2008-06-22 19:38:47, 83.4 KB) [[attachment:arnica_example3.png]]
  • [get | view] (2008-06-28 12:14:10, 38.9 KB) [[attachment:arnica_example5.png]]
  • [get | view] (2009-08-31 22:33:27, 22.3 KB) [[attachment:attachfile.patch]]
  • [get | view] (2009-08-31 22:36:36, 96.8 KB) [[attachment:attachfile.png]]
  • [get | view] (2009-09-04 11:39:45, 11.7 KB) [[attachment:background_1024x768.png]]
  • [get | view] (2009-10-05 10:49:10, 7.2 KB) [[attachment:c.png]]
  • [get | view] (2010-12-15 19:05:12, 5.7 KB) [[attachment:collapsed.png]]
  • [get | view] (2010-12-15 19:11:15, 20.1 KB) [[attachment:collapsed1.png]]
  • [get | view] (2010-12-16 08:10:18, 20.2 KB) [[attachment:collapsed2.png]]
  • [get | view] (2009-08-08 10:43:37, 48.2 KB) [[attachment:coverage_2.0.txt]]
  • [get | view] (2008-05-17 11:49:27, 1.9 KB) [[attachment:dicts_change.patch]]
  • [get | view] (2010-01-10 13:11:22, 14.3 KB) [[attachment:editmoin]]
  • [get | view] (2008-11-09 19:21:14, 6.0 KB) [[attachment:example.svg]]
  • [get | view] (2009-05-12 17:17:50, 33.5 KB) [[attachment:example_swf.png]]
  • [get | view] (2008-01-15 14:29:43, 243.9 KB) [[attachment:firefox_pdf.png]]
  • [get | view] (2009-10-11 14:11:41, 61.2 KB) [[attachment:kscan_0004.png]]
  • [get | view] (2008-12-30 17:50:02, 5.1 KB) [[attachment:latex2wiki.py]]
  • [get | view] (2008-03-21 17:04:38, 1.0 KB) [[attachment:maketestwiki.patch]]
  • [get | view] (2007-02-24 11:18:51, 1.4 KB) [[attachment:minipage.py]]
  • [get | view] (2009-08-08 16:16:13, 20.1 KB) [[attachment:moin-1.9-xapian-dmilajevs.txt]]
  • [get | view] (2009-08-08 22:55:55, 60.7 KB) [[attachment:moin-1.9.txt]]
  • [get | view] (2009-08-09 22:33:56, 29.2 KB) [[attachment:moin-2.0-storage.txt]]
  • [get | view] (2008-09-26 12:49:52, 684.7 KB) [[attachment:moinapi_beispiele.zip]]
  • [get | view] (2012-02-21 21:10:00, 37.7 KB) [[attachment:moinmoin_rb.png]]
  • [get | view] (2008-05-18 10:03:02, 3.8 KB) [[attachment:my_search.py]]
  • [get | view] (2009-09-07 13:00:22, 11.9 KB) [[attachment:navibar.png]]
  • [get | view] (2009-02-03 19:36:33, 4.2 KB) [[attachment:nbsp.jpg]]
  • [get | view] (2010-10-20 17:07:23, 318.5 KB) [[attachment:night_at_N1.jpg]]
  • [get | view] (2009-08-07 07:28:05, 736.1 KB) [[attachment:output.txt]]
  • [get | view] (2010-03-09 23:12:49, 0.6 KB) [[attachment:planning.zip]]
  • [get | view] (2010-08-14 09:50:12, 556.6 KB) [[attachment:preliminary_minefield.txt]]
  • [get | view] (2010-12-16 08:41:41, 66.8 KB) [[attachment:quicklinks1.png]]
  • [get | view] (2010-12-16 08:41:58, 117.3 KB) [[attachment:quicklinks2.png]]
  • [get | view] (2010-12-18 21:21:00, 13.1 KB) [[attachment:quicklinks3.png]]
  • [get | view] (2009-08-11 22:38:30, 221.4 KB) [[attachment:search.txt]]
  • [get | view] (2008-05-18 09:46:53, 1.6 KB) [[attachment:slapd.conf]]
  • [get | view] (2010-12-02 16:34:36, 123.0 KB) [[attachment:sunset.png]]
  • [get | view] (2009-09-23 15:12:58, 111.7 KB) [[attachment:svg-edit_ie8_chromeframe.png]]
  • [get | view] (2009-08-23 22:38:40, 43.4 KB) [[attachment:svg-editor_current_css.png]]
  • [get | view] (2009-04-14 21:22:58, 1.8 KB) [[attachment:test_strings.py]]
  • [get | view] (2009-01-06 00:11:59, 1.7 KB) [[attachment:text_gedit.patch]]
  • [get | view] (2009-07-12 10:51:27, 528.3 KB) [[attachment:the_end.jpg]]
  • [get | view] (2010-12-21 20:24:32, 22.3 KB) [[attachment:toctest1.png]]
  • [get | view] (2010-12-01 07:37:26, 186.8 KB) [[attachment:transcluded_video.png]]
  • [get | view] (2010-12-01 07:29:11, 264.0 KB) [[attachment:urlproblem.png]]
  • [get | view] (2010-11-28 23:56:54, 57.2 KB) [[attachment:wanted.png]]
  • [get | view] (2008-05-18 09:45:08, 3.4 KB) [[attachment:wikiconfig_snippet.txt]]
  • [get | view] (2009-08-09 18:00:32, 3.6 KB) [[attachment:xapian.txt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.