##// END OF EJS Templates
merge: move cwd-missing detection to helper functions...
Phil Cohen -
r34144:24bf8233 default
parent child Browse files
Show More
@@ -1084,18 +1084,21 b' def calculateupdates(repo, wctx, mctx, a'
1084 1084
1085 1085 return prunedactions, diverge, renamedelete
1086 1086
1087 def _getcwd():
1088 try:
1089 return pycompat.getcwd()
1090 except OSError as err:
1091 if err.errno == errno.ENOENT:
1092 return None
1093 raise
1094
1087 1095 def batchremove(repo, wctx, actions):
1088 1096 """apply removes to the working directory
1089 1097
1090 1098 yields tuples for progress updates
1091 1099 """
1092 1100 verbose = repo.ui.verbose
1093 try:
1094 cwd = pycompat.getcwd()
1095 except OSError as err:
1096 if err.errno != errno.ENOENT:
1097 raise
1098 cwd = None
1101 cwd = _getcwd()
1099 1102 i = 0
1100 1103 for f, args, msg in actions:
1101 1104 repo.ui.debug(" %s: %s -> r\n" % (f, msg))
@@ -1113,18 +1116,12 b' def batchremove(repo, wctx, actions):'
1113 1116 i += 1
1114 1117 if i > 0:
1115 1118 yield i, f
1116 if cwd:
1117 # cwd was present before we started to remove files
1118 # let's check if it is present after we removed them
1119 try:
1120 pycompat.getcwd()
1121 except OSError as err:
1122 if err.errno != errno.ENOENT:
1123 raise
1124 # Print a warning if cwd was deleted
1125 repo.ui.warn(_("current directory was removed\n"
1126 "(consider changing to repo root: %s)\n") %
1127 repo.root)
1119
1120 if cwd and not _getcwd():
1121 # cwd was removed in the course of removing files; print a helpful
1122 # warning.
1123 repo.ui.warn(_("current directory was removed\n"
1124 "(consider changing to repo root: %s)\n") % repo.root)
1128 1125
1129 1126 # It's necessary to flush here in case we're inside a worker fork and will
1130 1127 # quit after this function.
General Comments 0
You need to be logged in to leave comments. Login now