##// END OF EJS Templates
destupdate: have a generic and extensible way to run each step...
Pierre-Yves David -
r26726:8e664961 default
parent child Browse files
Show More
@@ -100,6 +100,15 b' def _destupdatebranch(repo, clean, check'
100 raise error.Abort(_("branch %s not found") % wc.branch())
100 raise error.Abort(_("branch %s not found") % wc.branch())
101 return node, movemark, None
101 return node, movemark, None
102
102
103 # order in which each step should be evalutated
104 # steps are run until one finds a destination
105 destupdatesteps = ['evolution', 'bookmark', 'branch']
106 # mapping to ease extension overriding steps.
107 destupdatestepmap = {'evolution': _destupdateobs,
108 'bookmark': _destupdatebook,
109 'branch': _destupdatebranch,
110 }
111
103 def destupdate(repo, clean=False, check=False):
112 def destupdate(repo, clean=False, check=False):
104 """destination for bare update operation
113 """destination for bare update operation
105
114
@@ -110,14 +119,12 b' def destupdate(repo, clean=False, check='
110 (cf bookmark.calculate update),
119 (cf bookmark.calculate update),
111 - activemark: a bookmark to activate at the end of the update.
120 - activemark: a bookmark to activate at the end of the update.
112 """
121 """
113 node = None
122 node = movemark = activemark = None
114 movemark = activemark = None
115
123
116 node, movemark, activemark = _destupdateobs(repo, clean, check)
124 for step in destupdatesteps:
117 if node is None:
125 node, movemark, activemark = destupdatestepmap[step](repo, clean, check)
118 node, movemark, activemark = _destupdatebook(repo, clean, check)
126 if node is not None:
119 if node is None:
127 break
120 node, movemark, activemark = _destupdatebranch(repo, clean, check)
121 rev = repo[node].rev()
128 rev = repo[node].rev()
122
129
123 _destupdatevalidate(repo, rev, clean, check)
130 _destupdatevalidate(repo, rev, clean, check)
General Comments 0
You need to be logged in to leave comments. Login now