##// END OF EJS Templates
hg: have `updatetotally` more thoroughly check updatecheck argument (API)...
Augie Fackler -
r43241:ee1ef76d default
parent child Browse files
Show More
@@ -883,6 +883,12 b' def clean(repo, node, show_stats=True, q'
883 # naming conflict in updatetotally()
883 # naming conflict in updatetotally()
884 _clean = clean
884 _clean = clean
885
885
886 _VALID_UPDATECHECKS = {mergemod.UPDATECHECK_ABORT,
887 mergemod.UPDATECHECK_NONE,
888 mergemod.UPDATECHECK_LINEAR,
889 mergemod.UPDATECHECK_NO_CONFLICT,
890 }
891
886 def updatetotally(ui, repo, checkout, brev, clean=False, updatecheck=None):
892 def updatetotally(ui, repo, checkout, brev, clean=False, updatecheck=None):
887 """Update the working directory with extra care for non-file components
893 """Update the working directory with extra care for non-file components
888
894
@@ -911,12 +917,12 b' def updatetotally(ui, repo, checkout, br'
911 """
917 """
912 if updatecheck is None:
918 if updatecheck is None:
913 updatecheck = ui.config('commands', 'update.check')
919 updatecheck = ui.config('commands', 'update.check')
914 if updatecheck not in (mergemod.UPDATECHECK_ABORT,
920 if updatecheck not in _VALID_UPDATECHECKS:
915 mergemod.UPDATECHECK_NONE,
916 mergemod.UPDATECHECK_LINEAR,
917 mergemod.UPDATECHECK_NO_CONFLICT):
918 # If not configured, or invalid value configured
921 # If not configured, or invalid value configured
919 updatecheck = mergemod.UPDATECHECK_LINEAR
922 updatecheck = mergemod.UPDATECHECK_LINEAR
923 if updatecheck not in _VALID_UPDATECHECKS:
924 raise ValueError(r'Invalid updatecheck value %r (can accept %r)' % (
925 updatecheck, _VALID_UPDATECHECKS))
920 with repo.wlock():
926 with repo.wlock():
921 movemarkfrom = None
927 movemarkfrom = None
922 warndest = False
928 warndest = False
General Comments 0
You need to be logged in to leave comments. Login now