##// END OF EJS Templates
copies: write empty entries in changeset when also writing to filelog...
Martin von Zweigbergk -
r42486:278dcb24 default
parent child Browse files
Show More
@@ -591,11 +591,11 b' class changelog(revlog.revlog):'
591 elif branch in (".", "null", "tip"):
591 elif branch in (".", "null", "tip"):
592 raise error.StorageError(_('the name \'%s\' is reserved')
592 raise error.StorageError(_('the name \'%s\' is reserved')
593 % branch)
593 % branch)
594 if (p1copies or p2copies) and extra is None:
594 if (p1copies is not None or p2copies is not None) and extra is None:
595 extra = {}
595 extra = {}
596 if p1copies:
596 if p1copies is not None:
597 extra['p1copies'] = encodecopies(p1copies)
597 extra['p1copies'] = encodecopies(p1copies)
598 if p2copies:
598 if p2copies is not None:
599 extra['p2copies'] = encodecopies(p2copies)
599 extra['p2copies'] = encodecopies(p2copies)
600
600
601 if extra:
601 if extra:
@@ -2650,6 +2650,14 b' class localrepository(object):'
2650 mn = p1.manifestnode()
2650 mn = p1.manifestnode()
2651 files = []
2651 files = []
2652
2652
2653 if writecopiesto == 'changeset-only':
2654 # If writing only to changeset extras, use None to indicate that
2655 # no entry should be written. If writing to both, write an empty
2656 # entry to prevent the reader from falling back to reading
2657 # filelogs.
2658 p1copies = p1copies or None
2659 p2copies = p2copies or None
2660
2653 # update changelog
2661 # update changelog
2654 self.ui.note(_("committing changelog\n"))
2662 self.ui.note(_("committing changelog\n"))
2655 self.changelog.delayupdate(tr)
2663 self.changelog.delayupdate(tr)
@@ -103,6 +103,7 b' Test writing to both changeset and filel'
103 $ hg changesetcopies
103 $ hg changesetcopies
104 files: j
104 files: j
105 p1copies: j\x00a (esc)
105 p1copies: j\x00a (esc)
106 p2copies:
106 $ hg debugdata j 0
107 $ hg debugdata j 0
107 \x01 (esc)
108 \x01 (esc)
108 copy: a
109 copy: a
@@ -115,6 +116,14 b' Test writing to both changeset and filel'
115 a -> j
116 a -> j
116 $ hg showcopies --config experimental.copies.read-from=filelog-only
117 $ hg showcopies --config experimental.copies.read-from=filelog-only
117 a -> j
118 a -> j
119 The entries should be written to extras even if they're empty (so the client
120 won't have to fall back to reading from filelogs)
121 $ echo x >> j
122 $ hg ci -m 'modify j' --config experimental.copies.write-to=compatibility
123 $ hg changesetcopies
124 files: j
125 p1copies:
126 p2copies:
118
127
119 Test writing only to filelog
128 Test writing only to filelog
120
129
General Comments 0
You need to be logged in to leave comments. Login now