Show More
@@ -1102,7 +1102,7 b' class committablectx(basectx):' | |||||
1102 | """A committablectx object provides common functionality for a context that |
|
1102 | """A committablectx object provides common functionality for a context that | |
1103 | wants the ability to commit, e.g. workingctx or memctx.""" |
|
1103 | wants the ability to commit, e.g. workingctx or memctx.""" | |
1104 | def __init__(self, repo, text="", user=None, date=None, extra=None, |
|
1104 | def __init__(self, repo, text="", user=None, date=None, extra=None, | |
1105 | changes=None): |
|
1105 | changes=None, branch=None): | |
1106 | super(committablectx, self).__init__(repo) |
|
1106 | super(committablectx, self).__init__(repo) | |
1107 | self._rev = None |
|
1107 | self._rev = None | |
1108 | self._node = None |
|
1108 | self._node = None | |
@@ -1117,7 +1117,9 b' class committablectx(basectx):' | |||||
1117 | self._extra = {} |
|
1117 | self._extra = {} | |
1118 | if extra: |
|
1118 | if extra: | |
1119 | self._extra = extra.copy() |
|
1119 | self._extra = extra.copy() | |
1120 |
if |
|
1120 | if branch is not None: | |
|
1121 | self._extra['branch'] = encoding.fromlocal(branch) | |||
|
1122 | elif 'branch' not in self._extra: | |||
1121 | try: |
|
1123 | try: | |
1122 | branch = encoding.fromlocal(self._repo.dirstate.branch()) |
|
1124 | branch = encoding.fromlocal(self._repo.dirstate.branch()) | |
1123 | except UnicodeDecodeError: |
|
1125 | except UnicodeDecodeError: | |
@@ -2308,7 +2310,8 b' class memctx(committablectx):' | |||||
2308 |
|
2310 | |||
2309 | def __init__(self, repo, parents, text, files, filectxfn, user=None, |
|
2311 | def __init__(self, repo, parents, text, files, filectxfn, user=None, | |
2310 | date=None, extra=None, branch=None, editor=False): |
|
2312 | date=None, extra=None, branch=None, editor=False): | |
2311 |
super(memctx, self).__init__(repo, text, user, date, extra |
|
2313 | super(memctx, self).__init__(repo, text, user, date, extra, | |
|
2314 | branch=branch) | |||
2312 | self._rev = None |
|
2315 | self._rev = None | |
2313 | self._node = None |
|
2316 | self._node = None | |
2314 | parents = [(p or nullid) for p in parents] |
|
2317 | parents = [(p or nullid) for p in parents] | |
@@ -2316,8 +2319,6 b' class memctx(committablectx):' | |||||
2316 | self._parents = [self._repo[p] for p in (p1, p2)] |
|
2319 | self._parents = [self._repo[p] for p in (p1, p2)] | |
2317 | files = sorted(set(files)) |
|
2320 | files = sorted(set(files)) | |
2318 | self._files = files |
|
2321 | self._files = files | |
2319 | if branch is not None: |
|
|||
2320 | self._extra['branch'] = encoding.fromlocal(branch) |
|
|||
2321 | self.substate = {} |
|
2322 | self.substate = {} | |
2322 |
|
2323 | |||
2323 | if isinstance(filectxfn, patch.filestore): |
|
2324 | if isinstance(filectxfn, patch.filestore): |
General Comments 0
You need to be logged in to leave comments.
Login now