##// END OF EJS Templates
filemerge: remove `premerge` argument from `_makebackup()`...
Martin von Zweigbergk -
r49262:0994125a default
parent child Browse files
Show More
@@ -924,7 +924,7 b' def _restorebackup(fcd, back):'
924 fcd.write(back.data(), fcd.flags())
924 fcd.write(back.data(), fcd.flags())
925
925
926
926
927 def _makebackup(repo, ui, wctx, fcd, premerge):
927 def _makebackup(repo, ui, wctx, fcd):
928 """Makes and returns a filectx-like object for ``fcd``'s backup file.
928 """Makes and returns a filectx-like object for ``fcd``'s backup file.
929
929
930 In addition to preserving the user's pre-existing modifications to `fcd`
930 In addition to preserving the user's pre-existing modifications to `fcd`
@@ -932,8 +932,8 b' def _makebackup(repo, ui, wctx, fcd, pre'
932 merge changed anything, and determine what line endings the new file should
932 merge changed anything, and determine what line endings the new file should
933 have.
933 have.
934
934
935 Backups only need to be written once (right before the premerge) since their
935 Backups only need to be written once since their content doesn't change
936 content doesn't change afterwards.
936 afterwards.
937 """
937 """
938 if fcd.isabsent():
938 if fcd.isabsent():
939 return None
939 return None
@@ -950,11 +950,9 b' def _makebackup(repo, ui, wctx, fcd, pre'
950 # merging in-memory, we must redirect the backup to the memory context
950 # merging in-memory, we must redirect the backup to the memory context
951 # so we don't disturb the working directory.
951 # so we don't disturb the working directory.
952 relpath = back[len(repo.wvfs.base) + 1 :]
952 relpath = back[len(repo.wvfs.base) + 1 :]
953 if premerge:
954 wctx[relpath].write(fcd.data(), fcd.flags())
953 wctx[relpath].write(fcd.data(), fcd.flags())
955 return wctx[relpath]
954 return wctx[relpath]
956 else:
955 else:
957 if premerge:
958 # Otherwise, write to wherever path the user specified the backups
956 # Otherwise, write to wherever path the user specified the backups
959 # should go. We still need to switch based on whether the source is
957 # should go. We still need to switch based on whether the source is
960 # in-memory so we can use the fast path of ``util.copy`` if both are
958 # in-memory so we can use the fast path of ``util.copy`` if both are
@@ -1121,7 +1119,7 b' def filemerge(repo, wctx, mynode, orig, '
1121 ui.warn(onfailure % fduipath)
1119 ui.warn(onfailure % fduipath)
1122 return True, 1, False
1120 return True, 1, False
1123
1121
1124 back = _makebackup(repo, ui, wctx, fcd, True)
1122 back = _makebackup(repo, ui, wctx, fcd)
1125 files = (None, None, None, back)
1123 files = (None, None, None, back)
1126 r = 1
1124 r = 1
1127 try:
1125 try:
General Comments 0
You need to be logged in to leave comments. Login now