Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 29181:dae38633eba8 stable
localrepo: prevent executable-bit only changes from being lost on amend
If you have just executable-bit change and amend it twice it will vanish:
* After the first amend the commit will have the proper executable bit set
in manifest but it won't have the the file on the list of files in
changelog.
* The second amend will read the wrong list of files from changelog and it
will copy the manifest entry from parent for this file.
* Voila! The change is lost.
This change repairs the bug in localrepo causing this and adds a test for it.
author | Mateusz Kwapich <mitrandir@fb.com> |
---|---|
date | Thu, 19 May 2016 14:35:22 -0700 |
parents | 032c4c2f802a |
children | ee935a6e1ea2 |
comparison
equal
deleted
inserted
replaced
29180:8c5e880c7e25 | 29181:dae38633eba8 |
---|---|
1402 fparent2 = manifest2.get(fname, nullid) | 1402 fparent2 = manifest2.get(fname, nullid) |
1403 if isinstance(fctx, context.filectx): | 1403 if isinstance(fctx, context.filectx): |
1404 node = fctx.filenode() | 1404 node = fctx.filenode() |
1405 if node in [fparent1, fparent2]: | 1405 if node in [fparent1, fparent2]: |
1406 self.ui.debug('reusing %s filelog entry\n' % fname) | 1406 self.ui.debug('reusing %s filelog entry\n' % fname) |
1407 if manifest1.flags(fname) != fctx.flags(): | |
1408 changelist.append(fname) | |
1407 return node | 1409 return node |
1408 | 1410 |
1409 flog = self.file(fname) | 1411 flog = self.file(fname) |
1410 meta = {} | 1412 meta = {} |
1411 copy = fctx.renamed() | 1413 copy = fctx.renamed() |