Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

menuthg: context menu tweaks

* tracked state should include clean files (UNCHANGED)
* Change 'Undo Changes' to 'Revert Changes' to be consistent with hg command name
* Update (checkout) and (Un)Merge are not valid with file selections
* Change 'Search Repository' to 'Search History'
* Append 'Settings' after 'Global' and 'Repository' (submenu is not necessary)

Changeset cd0ea18a8a90

Parent 559befa12df5

by Steve Borho

Changes to one file · Browse files at cd0ea18a8a90 Showing diff from parent 559befa12df5 Diff from another changeset...

 
206
207
208
209
 
 
210
211
212
 
255
256
257
258
 
259
260
261
 
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
 
289
290
291
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
294
295
 
314
315
316
317
318
319
320
321
322
323
324
 
 
 
 
 
 
 
 
325
326
327
 
206
207
208
 
209
210
211
212
213
 
256
257
258
 
259
260
261
262
 
267
268
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
271
272
 
274
275
276
 
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
 
315
316
317
 
 
 
 
 
 
 
 
318
319
320
321
322
323
324
325
326
327
328
@@ -206,7 +206,8 @@
    changed = bool(states & set([cachethg.ADDED, cachethg.MODIFIED]))   modified = cachethg.MODIFIED in states - tracked = changed or modified + clean = cachethg.UNCHANGED in states + tracked = changed or modified or clean   new = bool(states & set([cachethg.UNKNOWN, cachethg.IGNORED]))     menu = thg_menu(repo.ui, self.name) @@ -255,7 +256,7 @@
  _("Remove selected files on the next commit"),   'remove', icon="menudelete.ico")   if files and changed: - menu.add_menu(_("Undo Changes"), + menu.add_menu(_("Revert Changes"),   _("Revert selected files"),   'revert', icon="menurevert.ico")   @@ -266,22 +267,6 @@
  'datamine', icon="menublame.ico")     menu.add_sep() - menu.add_menu(_("Update To Revision"), - _("update working directory"), - 'update', icon="menucheckout.ico") - - if len(repo.changectx(None).parents()) < 2: - menu.add_menu(_("Merge Revisions"), - _("merge working directory with another revision"), - 'merge', icon="menumerge.ico") - - inmerge = len(repo.changectx(None).parents()) > 1 - if inmerge: - menu.add_menu(_("Undo Merge"), - _("Undo merge by updating to revision"), - 'merge', icon="menuunmerge.ico") - - menu.add_sep()     if tracked:   menu.add_menu(_("View Changelog"), @@ -289,7 +274,23 @@
  'history', icon="menulog.ico")     if len(files) == 0: - menu.add_menu(_("Search Repository"), + menu.add_sep() + menu.add_menu(_("Update To Revision"), + _("update working directory"), + 'update', icon="menucheckout.ico") + + if len(repo.changectx(None).parents()) < 2: + menu.add_menu(_("Merge Revisions"), + _("merge working directory with another revision"), + 'merge', icon="menumerge.ico") + + inmerge = len(repo.changectx(None).parents()) > 1 + if inmerge: + menu.add_menu(_("Undo Merge"), + _("Undo merge by updating to revision"), + 'merge', icon="menuunmerge.ico") + + menu.add_menu(_("Search History"),   _("Search revisions of files for a text pattern"),   'datamine', icon="menurepobrowse.ico")   @@ -314,14 +315,14 @@
  _("create a new repository in this directory"),   'init', icon="menucreaterepos.ico")   - # config settings menu - menu.add_sep() - menu.add_menu(_("Global"), - _("Configure user wide settings"), - 'userconfig', icon="settings_user.ico") - menu.add_menu(_("Repository"), - _("Configure settings local to this repository"), - 'repoconfig', icon="settings_repo.ico") + # config settings menu + menu.add_sep() + menu.add_menu(_("Global Settings"), + _("Configure user wide settings"), + 'userconfig', icon="settings_user.ico") + menu.add_menu(_("Repository Settings"), + _("Configure settings local to this repository"), + 'repoconfig', icon="settings_repo.ico")     # add common menu items   menu.add_sep()