##// END OF EJS Templates
bookmarks: merge current tracking on update into core
Matt Mackall -
r13367:cef73cd9 default
parent child Browse files
Show More
@@ -196,9 +196,6 b' def push(oldpush, ui, repo, dest=None, *'
196 196 return result
197 197
198 198 def uisetup(ui):
199 if ui.configbool('bookmarks', 'track.current'):
200 extensions.wrapcommand(commands.table, 'update', updatecurbookmark)
201
202 199 entry = extensions.wrapcommand(commands.table, 'pull', pull)
203 200 entry[1].append(('B', 'bookmark', [],
204 201 _("bookmark to import"),
@@ -208,19 +205,6 b' def uisetup(ui):'
208 205 _("bookmark to export"),
209 206 _('BOOKMARK')))
210 207
211 def updatecurbookmark(orig, ui, repo, *args, **opts):
212 '''Set the current bookmark
213
214 If the user updates to a bookmark we update the .hg/bookmarks.current
215 file.
216 '''
217 res = orig(ui, repo, *args, **opts)
218 rev = opts['rev']
219 if not rev and len(args) > 0:
220 rev = args[0]
221 bookmarks.setcurrent(repo, rev)
222 return res
223
224 208 cmdtable = {
225 209 "bookmarks":
226 210 (bookmark,
@@ -3893,9 +3893,14 b' def update(ui, repo, node=None, rev=None'
3893 3893 rev = cmdutil.finddate(ui, repo, date)
3894 3894
3895 3895 if clean or check:
3896 return hg.clean(repo, rev)
3896 ret = hg.clean(repo, rev)
3897 3897 else:
3898 return hg.update(repo, rev)
3898 ret = hg.update(repo, rev)
3899
3900 if repo.ui.configbool('bookmarks', 'track.current'):
3901 bookmarks.setcurrent(repo, rev)
3902
3903 return ret
3899 3904
3900 3905 def verify(ui, repo):
3901 3906 """verify the integrity of the repository
General Comments 0
You need to be logged in to leave comments. Login now