PropertyConstraintException for 'scm create changeset'
Daniel Junglas (21●4●4)
| asked Mar 28 '12, 11:40 a.m.
retagged Dec 10 '12, 3:21 a.m. by Martin Dam Pedersen (135●2●8●14)
When trying to create a changeset using the command line interface (scm) I got
The comment for the changeset is auto-generated and long (1033 lines, 44538 characters). Could that be the reason for the exception? I have seen this exception several times and always long comments were involved. For short comments I have not seen the exception yet. Is there a limit to the length of change set comments? I could not find a documented limit so far, but I might have looked in the wrong places. Thanks, Daniel |
3 answers
Well, I suppose that Java code won't really help for the command line, but at least I can confirm that would be why you can't save a change set.
But here's a non-internal way on how to truncate it yourself the Java way:
|
...The comment for the changeset is auto-generated and long (1033 lines, 44538 characters). Yes, that is the issue. I don't recall offhand what the max byte size is for the change set comment property, but you can use this helper method to provide you with the longest possible comment that is valid (it will only truncate if it needs to) String shorterComment = com.ibm.team.scm.common.internal.util.ValidationUtils.truncate(IChangeSet.ITEM_TYPE, IChangeSet.COMMENT_PROPERTY, longComment); |
Thanks a lot! That was very helpful. I used your code snippet to figure out that the maximum length for a comment on my RTC instance is 32768 characters. I can now use this limit to trim my comments for the command line interface.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.