Show More
@@ -1119,13 +1119,7 b' class committablectx(basectx):' | |||
|
1119 | 1119 | self._extra = extra.copy() |
|
1120 | 1120 | if branch is not None: |
|
1121 | 1121 | self._extra['branch'] = encoding.fromlocal(branch) |
|
1122 |
|
|
|
1123 | try: | |
|
1124 | branch = encoding.fromlocal(self._repo.dirstate.branch()) | |
|
1125 | except UnicodeDecodeError: | |
|
1126 | raise error.Abort(_('branch name not in UTF-8!')) | |
|
1127 | self._extra['branch'] = branch | |
|
1128 | if self._extra['branch'] == '': | |
|
1122 | if not self._extra.get('branch'): | |
|
1129 | 1123 | self._extra['branch'] = 'default' |
|
1130 | 1124 | |
|
1131 | 1125 | def __bytes__(self): |
@@ -1242,7 +1236,14 b' class workingctx(committablectx):' | |||
|
1242 | 1236 | """ |
|
1243 | 1237 | def __init__(self, repo, text="", user=None, date=None, extra=None, |
|
1244 | 1238 | changes=None): |
|
1245 | super(workingctx, self).__init__(repo, text, user, date, extra, changes) | |
|
1239 | branch = None | |
|
1240 | if not extra or 'branch' not in extra: | |
|
1241 | try: | |
|
1242 | branch = repo.dirstate.branch() | |
|
1243 | except UnicodeDecodeError: | |
|
1244 | raise error.Abort(_('branch name not in UTF-8!')) | |
|
1245 | super(workingctx, self).__init__(repo, text, user, date, extra, changes, | |
|
1246 | branch=branch) | |
|
1246 | 1247 | |
|
1247 | 1248 | def __iter__(self): |
|
1248 | 1249 | d = self._repo.dirstate |
General Comments 0
You need to be logged in to leave comments.
Login now