# HG changeset patch # User Pierre-Yves David # Date 1417045021 28800 # Node ID cd9e5e57064da59a2991bce1353de9696eb7a20e # Parent 36dcd3db70ab1dce7715ead123aa4bb4f09b1abc manifest: document the extra letter in working copy manifest node As the second developer to get confused by this in November, I'm adding some documentation for the next poor soul. diff -r 36dcd3db70ab -r cd9e5e57064d mercurial/context.py --- a/mercurial/context.py Sun Nov 30 20:06:53 2014 +0100 +++ b/mercurial/context.py Wed Nov 26 15:37:01 2014 -0800 @@ -1035,7 +1035,13 @@ @propertycache def _manifest(self): - """generate a manifest corresponding to the values in self._status""" + """generate a manifest corresponding to the values in self._status + + This reuse the file nodeid from parent, but we append an extra letter + when modified. Modified files get an extra 'm' while added files get + appened an extra 'a'. This is used by manifests merge to see that files + are different and by update logic to avoid deleting newly added files. + """ man1 = self._parents[0].manifest() man = man1.copy() diff -r 36dcd3db70ab -r cd9e5e57064d mercurial/merge.py --- a/mercurial/merge.py Sun Nov 30 20:06:53 2014 +0100 +++ b/mercurial/merge.py Wed Nov 26 15:37:01 2014 -0800 @@ -457,7 +457,10 @@ actions['r'].append((f, None, "remote delete")) else: actions['cd'].append((f, None, "prompt changed/deleted")) - elif n1[20:] == 'a': # added, no remote + elif n1[20:] == 'a': + # This extra 'a' is added by working copy manifest to mark the + # file as locally added. We should forget it instead of + # deleting it. actions['f'].append((f, None, "remote deleted")) else: actions['r'].append((f, None, "other deleted"))