Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgChangelog.java @ 386:73e875154afb
Do not fail with empty extras string in changeset
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 13 Feb 2012 14:52:21 +0100 |
parents | 2fadf8695f8a |
children | 528b6780a8bd |
comparison
equal
deleted
inserted
replaced
385:6150555eb41d | 386:73e875154afb |
---|---|
282 // unixTime is local time, and timezone records difference of the local time to UTC. | 282 // unixTime is local time, and timezone records difference of the local time to UTC. |
283 Date _time = new Date(unixTime * 1000); | 283 Date _time = new Date(unixTime * 1000); |
284 String _extras = space2 < _timeString.length() ? _timeString.substring(space2 + 1) : null; | 284 String _extras = space2 < _timeString.length() ? _timeString.substring(space2 + 1) : null; |
285 Map<String, String> _extrasMap; | 285 Map<String, String> _extrasMap; |
286 final String extras_branch_key = "branch"; | 286 final String extras_branch_key = "branch"; |
287 if (_extras == null) { | 287 if (_extras == null || _extras.trim().length() == 0) { |
288 _extrasMap = Collections.singletonMap(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); | 288 _extrasMap = Collections.singletonMap(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); |
289 } else { | 289 } else { |
290 _extrasMap = new HashMap<String, String>(); | 290 _extrasMap = new HashMap<String, String>(); |
291 for (String pair : _extras.split("\00")) { | 291 for (String pair : _extras.split("\00")) { |
292 pair = decode(pair); | 292 pair = decode(pair); |