130 filesadded, filesremoved = None, None |
130 filesadded, filesremoved = None, None |
131 if ctx.manifestnode(): |
131 if ctx.manifestnode(): |
132 # reuse an existing manifest revision |
132 # reuse an existing manifest revision |
133 repo.ui.debug(b'reusing known manifest\n') |
133 repo.ui.debug(b'reusing known manifest\n') |
134 mn = ctx.manifestnode() |
134 mn = ctx.manifestnode() |
135 files = ctx.files() |
135 touched = ctx.files() |
136 if writechangesetcopy: |
136 if writechangesetcopy: |
137 filesadded = ctx.filesadded() |
137 filesadded = ctx.filesadded() |
138 filesremoved = ctx.filesremoved() |
138 filesremoved = ctx.filesremoved() |
139 elif not ctx.files(): |
139 elif not ctx.files(): |
140 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') |
140 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') |
141 mn = p1.manifestnode() |
141 mn = p1.manifestnode() |
142 files = [] |
142 touched = [] |
143 else: |
143 else: |
144 mn, files, added, removed = _process_files(tr, ctx, error=error) |
144 mn, touched, added, removed = _process_files(tr, ctx, error=error) |
145 if writechangesetcopy: |
145 if writechangesetcopy: |
146 filesremoved = removed |
146 filesremoved = removed |
147 filesadded = added |
147 filesadded = added |
148 |
148 |
149 if origctx and origctx.manifestnode() == mn: |
149 if origctx and origctx.manifestnode() == mn: |
150 files = origctx.files() |
150 touched = origctx.files() |
151 |
151 |
152 if not writefilecopymeta: |
152 if not writefilecopymeta: |
153 # If writing only to changeset extras, use None to indicate that |
153 # If writing only to changeset extras, use None to indicate that |
154 # no entry should be written. If writing to both, write an empty |
154 # no entry should be written. If writing to both, write an empty |
155 # entry to prevent the reader from falling back to reading |
155 # entry to prevent the reader from falling back to reading |
157 p1copies = p1copies or None |
157 p1copies = p1copies or None |
158 p2copies = p2copies or None |
158 p2copies = p2copies or None |
159 filesadded = filesadded or None |
159 filesadded = filesadded or None |
160 filesremoved = filesremoved or None |
160 filesremoved = filesremoved or None |
161 |
161 |
162 return mn, files, p1copies, p2copies, filesadded, filesremoved |
162 return mn, touched, p1copies, p2copies, filesadded, filesremoved |
163 |
163 |
164 |
164 |
165 def _process_files(tr, ctx, error=False): |
165 def _process_files(tr, ctx, error=False): |
166 repo = ctx.repo() |
166 repo = ctx.repo() |
167 p1 = ctx.p1() |
167 p1 = ctx.p1() |