Skip to content
Snippets Groups Projects
  • Gregory Szorc's avatar
    3d0feb2f
    histedit: pick an appropriate base changeset by default (BC) · 3d0feb2f
    Gregory Szorc authored
    Previously, `hg histedit` required a revision argument specifying which
    revision to use as the base for the current histedit operation. There
    was an undocumented and experimental "histedit.defaultrev" option that
    supported defining a single revision to be used if no argument is
    passed.
    
    Mercurial knows what changesets can be edited. And in most scenarios,
    people want to edit this history of everything on the current head that
    is rewritable. Making histedit do this by default and not require
    an explicit argument or additional configuration is a major usability
    win and will enable more people to use histedit.
    
    This patch changes the behavior of the experimental and undocumented
    "histedit.defaultrev" config option to select an appropriate base
    revision by default. Comprehensive tests exercising the edge cases
    in the new, somewhat complicated default revset have been added.
    Surprisingly, no tests broke. I guess we were never testing the
    behavior with no ANCESTOR argument (it used to fail with
    "abort: histedit requires exactly one ancestor revision"). The new
    behavior is much more user friendly.
    
    The functionality for choosing the default base revision has been
    moved to destutil.py, where it can easily be modified by extensions.
    3d0feb2f
    History
    histedit: pick an appropriate base changeset by default (BC)
    Gregory Szorc authored
    Previously, `hg histedit` required a revision argument specifying which
    revision to use as the base for the current histedit operation. There
    was an undocumented and experimental "histedit.defaultrev" option that
    supported defining a single revision to be used if no argument is
    passed.
    
    Mercurial knows what changesets can be edited. And in most scenarios,
    people want to edit this history of everything on the current head that
    is rewritable. Making histedit do this by default and not require
    an explicit argument or additional configuration is a major usability
    win and will enable more people to use histedit.
    
    This patch changes the behavior of the experimental and undocumented
    "histedit.defaultrev" config option to select an appropriate base
    revision by default. Comprehensive tests exercising the edge cases
    in the new, somewhat complicated default revset have been added.
    Surprisingly, no tests broke. I guess we were never testing the
    behavior with no ANCESTOR argument (it used to fail with
    "abort: histedit requires exactly one ancestor revision"). The new
    behavior is much more user friendly.
    
    The functionality for choosing the default base revision has been
    moved to destutil.py, where it can easily be modified by extensions.