D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread ikostia (Kostia Balytskyi)
ikostia accepted this revision. ikostia added a comment. LGTM REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D865 To: swhitaker, #hg-reviewers, ikostia Cc: pulkit, ikostia, mercurial-devel ___ Mercurial-devel mailing

D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread swhitaker (Simon Whitaker)
swhitaker updated this revision to Diff 2255. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D865?vs=2229=2255 REVISION DETAIL https://phab.mercurial-scm.org/D865 AFFECTED FILES mercurial/obsolete.py tests/test-obsolete-bounds-checking.t CHANGE

D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread ikostia (Kostia Balytskyi)
ikostia added a comment. That is why we raise `ProgrammingError`, not some sort of `UserError`. If your extension writes metadata longer than 255 chars, it is a bad extension. Your proposal is weird, because it is quietly modifying things, IMO this is much worse. I'd rather be forced to

D865: obsmarker: fix crash when metadata fields are >255 bytes

2017-10-01 Thread swhitaker (Simon Whitaker)
swhitaker added a comment. @ikostia Sure, I can change this. What should we do if the metadata value is not under user control? In the case of a username longer than 255 bytes, the user can change that in their hgrc (although it's debatable whether they should; "error, your name is too

D865: obsmarker: fix crash when metadata fields are >255 bytes

2017-10-01 Thread pulkit (Pulkit Goyal)
pulkit added a comment. Also we append the issue number in the commit message at the end like `(issue)` so that the Bugzilla bot can automatically close that. For reference: https://www.mercurial-scm.org/repo/hg-committed/log?rev=issue=20 REPOSITORY rHG Mercurial REVISION DETAIL

D865: obsmarker: fix crash when metadata fields are >255 bytes

2017-10-01 Thread ikostia (Kostia Balytskyi)
ikostia requested changes to this revision. ikostia added a comment. This revision now requires changes to proceed. I would rather see this thing do `raise error.ProrgrammingError('metadata cannot be longer than 255 bytes')` (or some other message). REPOSITORY rHG Mercurial REVISION

D865: obsmarker: fix crash when metadata fields are >255 bytes

2017-10-01 Thread swhitaker (Simon Whitaker)
swhitaker created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Various mutators fail when attempting to write obsmarkers with metadata fields longer than 255 bytes, since the length of mwetadata fields is stored in u8s.