Note:

This page is primarily intended for developers of Mercurial.

Plan for 'hg histedit' with no revision arguments

/!\ This is a DRAFT for discussion, and does not represent any firm decisions on future behavior.

1. Today

augie% hg histedit
abort: histedit requires exactly one ancestor revision
augie% hg histedit 'some revset with multiple roots'
abort: histedit requires exactly one ancestor revision

2. Proposal

augie% hg histedit 'some revset with multiple roots'
abort: histedit requires exactly one ancestor revision
augie% hg histedit
abort: histedit requires history to edit
(hint: try 'hg histedit "draft() and only(.)"' or 'hg histedit "draft() and outgoing()"')

Plus, add a config option that's the default, eg:

[histedit]
defaultedit = # set this to make histedit without arguments work

so if I have

[histedit]
defaultedit = draft() and only(.)

I do

augie% hg histedit

and my editor fills with this:

# revisions automatically picked using "draft() and only(.)"
# to change this default, edit your hgrc
pick a2470d767056 27572 test-extension: use a realistic Mercurial version
pick ed2fbd8baa9c 27574 dispatch: only check compatibility against major and ...
# Edit history between a2470d767056 and ed2fbd8baa9c
#
# Commits are listed from least to most recent
#
# Commands:
#  p, pick = use commit
#  e, edit = use commit, but stop for amending
#  f, fold = use commit, but combine it with the one above
#  r, roll = like fold, but discard this commit's description
#  d, drop = remove commit from history
#  m, mess = edit message without changing commit content
#

OPEN PROBLEMS:

  1. Probably only want to go back to a merge?
  2. Should we just have a global default?
    1. durham likes (only(.) & draft()) - ::merge()

    2. augie thinks durham is probably right about that default, but wants to see how it feels for a while.

HisteditNoArgumentsPlan (last edited 2015-01-16 19:14:57 by AugieFackler)