Mercurial > hg4j
diff 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 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgChangelog.java Fri Aug 12 19:12:04 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgChangelog.java Mon Aug 15 18:51:41 2011 +0200 @@ -259,8 +259,9 @@ Date _time = new Date(unixTime * 1000); String _extras = space2 < _timeString.length() ? _timeString.substring(space2 + 1) : null; Map<String, String> _extrasMap; + final String extras_branch_key = "branch"; if (_extras == null) { - _extrasMap = Collections.singletonMap("branch", "default"); + _extrasMap = Collections.singletonMap(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); } else { _extrasMap = new HashMap<String, String>(); for (String pair : _extras.split("\00")) { @@ -268,8 +269,8 @@ // FIXME need to decode key/value, @see changelog.py:decodeextra _extrasMap.put(pair.substring(0, eq), pair.substring(eq + 1)); } - if (!_extrasMap.containsKey("branch")) { - _extrasMap.put("branch", "default"); + if (!_extrasMap.containsKey(extras_branch_key)) { + _extrasMap.put(extras_branch_key, HgRepository.DEFAULT_BRANCH_NAME); } _extrasMap = Collections.unmodifiableMap(_extrasMap); }