##// END OF EJS Templates
context: default to using branch from dirstate only in workingctx...
Martin von Zweigbergk -
r42483:62bb49a1 default
parent child Browse files
Show More
@@ -1119,13 +1119,7 b' class committablectx(basectx):'
1119 self._extra = extra.copy()
1119 self._extra = extra.copy()
1120 if branch is not None:
1120 if branch is not None:
1121 self._extra['branch'] = encoding.fromlocal(branch)
1121 self._extra['branch'] = encoding.fromlocal(branch)
1122 elif 'branch' not in self._extra:
1122 if not self._extra.get('branch'):
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'] == '':
1129 self._extra['branch'] = 'default'
1123 self._extra['branch'] = 'default'
1130
1124
1131 def __bytes__(self):
1125 def __bytes__(self):
@@ -1242,7 +1236,14 b' class workingctx(committablectx):'
1242 """
1236 """
1243 def __init__(self, repo, text="", user=None, date=None, extra=None,
1237 def __init__(self, repo, text="", user=None, date=None, extra=None,
1244 changes=None):
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 def __iter__(self):
1248 def __iter__(self):
1248 d = self._repo.dirstate
1249 d = self._repo.dirstate
General Comments 0
You need to be logged in to leave comments. Login now