Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgChangelog.java @ 252:a6d19adc2636
HgRepository.getWorkingCopyBranchName() to retrieve branch associated with working directory
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Mon, 15 Aug 2011 18:51:41 +0200 |
| parents | ad6a046943be |
| children | f9f3e9b67ccc |
comparison
equal
deleted
inserted
replaced
| 251:8c951645bea0 | 252:a6d19adc2636 |
|---|---|
| 257 // XXX not sure need to add timezone here - I can't figure out whether Hg keeps GMT time, and records timezone just for info, or unixTime is taken local | 257 // XXX not sure need to add timezone here - I can't figure out whether Hg keeps GMT time, and records timezone just for info, or unixTime is taken local |
| 258 // on commit and timezone is recorded to adjust it to UTC. | 258 // on commit and timezone is recorded to adjust it to UTC. |
| 259 Date _time = new Date(unixTime * 1000); | 259 Date _time = new Date(unixTime * 1000); |
| 260 String _extras = space2 < _timeString.length() ? _timeString.substring(space2 + 1) : null; | 260 String _extras = space2 < _timeString.length() ? _timeString.substring(space2 + 1) : null; |
| 261 Map<String, String> _extrasMap; | 261 Map<String, String> _extrasMap; |
| 262 final String extras_branch_key = "branch"; | |
| 262 if (_extras == null) { | 263 if (_extras == null) { |
| 263 _extrasMap = Collections.singletonMap("branch", "default"); | 264 _extrasMap = Collections.singletonMap(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); |
| 264 } else { | 265 } else { |
| 265 _extrasMap = new HashMap<String, String>(); | 266 _extrasMap = new HashMap<String, String>(); |
| 266 for (String pair : _extras.split("\00")) { | 267 for (String pair : _extras.split("\00")) { |
| 267 int eq = pair.indexOf(':'); | 268 int eq = pair.indexOf(':'); |
| 268 // FIXME need to decode key/value, @see changelog.py:decodeextra | 269 // FIXME need to decode key/value, @see changelog.py:decodeextra |
| 269 _extrasMap.put(pair.substring(0, eq), pair.substring(eq + 1)); | 270 _extrasMap.put(pair.substring(0, eq), pair.substring(eq + 1)); |
| 270 } | 271 } |
| 271 if (!_extrasMap.containsKey("branch")) { | 272 if (!_extrasMap.containsKey(extras_branch_key)) { |
| 272 _extrasMap.put("branch", "default"); | 273 _extrasMap.put(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); |
| 273 } | 274 } |
| 274 _extrasMap = Collections.unmodifiableMap(_extrasMap); | 275 _extrasMap = Collections.unmodifiableMap(_extrasMap); |
| 275 } | 276 } |
| 276 | 277 |
| 277 // | 278 // |
