https://bz.mercurial-scm.org/show_bug.cgi?id=5345

            Bug ID: 5345
           Summary: commit -i should be smarter about replacement lines
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: record
          Assignee: bugzi...@selenic.com
          Reporter: timel...@gmail.com
                CC: mercurial-de...@selenic.com

using `hg commit -i` you can get a hunk like this:

   [~]     @@ -533,8 +533,8 @@ namespace Microsoft.PowerShell.Commands.
                    /// <summary>
                    /// helper to to add any pre-load intrinsics to the db
                    /// </summary>
      [x]  -        /// <param name="db">db being iniitalized</param>
      [ ]  -        private static void AddPreLoadInstrinsics(TypeInfoDataBase
db)
      [x]  +        /// <param name="db">db being initialized</param>
      [ ]  +        private static void AddPreLoadIntrinsics(TypeInfoDataBase
db)
                    {
                        // NOTE: nothing to add for the time being. Add here if
needed.
                    }

I expect it to be handled the same way as:
   [~]     @@ -533,8 +533,8 @@ namespace Microsoft.PowerShell.Commands.
                    /// <summary>
                    /// helper to to add any pre-load intrinsics to the db
                    /// </summary>
      [x]  -        /// <param name="db">db being iniitalized</param>
      [x]  +        /// <param name="db">db being initialized</param>
      [ ]  -        private static void AddPreLoadInstrinsics(TypeInfoDataBase
db)
      [ ]  +        private static void AddPreLoadIntrinsics(TypeInfoDataBase
db)
                    {
                        // NOTE: nothing to add for the time being. Add here if
needed.
                    }

There are various ways to make this more practical, one is to allow users to
reorder lines using extra keys (as chistedit does).

Another would be to try to identify replacement lines and automatically order
them as such initially:

   [x]     @@ -533,8 +533,8 @@ namespace Microsoft.PowerShell.Commands.
                    /// <summary>
                    /// helper to to add any pre-load intrinsics to the db
                    /// </summary>
      [x]  -        /// <param name="db">db being iniitalized</param>
      [x]  +        /// <param name="db">db being initialized</param>
      [x]  -        private static void AddPreLoadInstrinsics(TypeInfoDataBase
db)
      [x]  +        private static void AddPreLoadIntrinsics(TypeInfoDataBase
db)
                    {
                        // NOTE: nothing to add for the time being. Add here if
needed.
                    }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to