wiki:Features/EditPatch
Last modified 3 years ago Last modified on 09/28/11 09:53:08

<-back

Edit -> Patch

Patch only works on files in local editor that are saved, ie it ignores files with leading * prefix in there name.

It is simplistic in it's approach, as it only works on one file at a time, If you need to work with files/projects look at one of our Plug-ins.

Patch tries to auto select the correct file in each list where relevant.

  • the techie one liner Action, Against, Select File-1, Select File-2 if appropriate and then Process

Thanks to All the active members for there help with this addition


Right Click

If your current file in Padre is a patch file ( *.patch or *.diff ) and you Right click you get the following.

Right Click now shows Patch, as current file has an extension of patch

You will notice a short cut to Patch... has appeared.


Using Patch

  • To Launch the Patch Dialogue, Menu Bar, Edit->Patch...
  • By default Patch will assume it is working in Patch mode and if started with a *.patch file as current file. Patch will try to find among the other open files a corresponding file to apply the *.patch against as shown below.

shows Patch load via right_click

Logic

Againstcomments
PatchFile-1File-2auto select File-1 based on File-2 name, File-2 auto select based on extension
ActionDiffFile-1File-2auto select File-1 based on current file, File-2 auto select file 0
DiffFile-1SVNauto select File-1 based on current file,File-2 n/a

Output

  • Normal information will go to Padre status bar.
    • We have assumed Show low-priority info messages on Status-bar (not in a pop-up) is true,
  • Patch results in a new Tab in Padre editor titled unsaved
  • Diff results in file-name suffixed with .patch, saved in same location as file-name and opened in Padre editor.

Error / Info

  • Any error message will be displayed in Padre Output panel.
  • SVN version violation information is displayed in the status bar.

Miscellaneous

  • Patch uses Text::Patch.
  • Diff uses Text::Diff.
    • SVN local client is used if present, if not SVN radio button will be greyed out.
  • Patch... will be greyed out if there are no open files in editor.

Limitations

  • File List display in order files were loaded into Padre, if you have move files around by dragging there Tab this will not be reflected in List display order.
  • If you have multiple files open with same name but with different paths only the first will get matched.
  • SVN local Client is also tested for version greater than or equal to 1.6.2.
    • From Subversion changes:- fixed: segfault on merge with servers < 1.6 (r37363, -67, -68, -79)
  • Patch some times throws errors relating to POD lines starting with ( C<, =, ) giving the following output.
    • Hunk #n failed at line xxx.

ToDo

  • Use a different solution to SVN::Class which is not *inux centric.
  • add tests 96_edit_patch.t


__END__

<-back

Attachments