summaryrefslogtreecommitdiff
path: root/IkiWiki/Rcs/Stub.pm
blob: 43a2f20299c7da33be1efd8a21236319fd8110d7 (plain)
  1. #!/usr/bin/perl
  2. # Stubs for no revision control.
  3. package IkiWiki;
  4. use warnings;
  5. use strict;
  6. use IkiWiki;
  7. sub rcs_update () {
  8. # Update working directory to current version.
  9. # (May be more complex for distributed RCS.)
  10. }
  11. sub rcs_prepedit ($) {
  12. # Prepares to edit a file under revision control. Returns a token
  13. # that must be passed into rcs_commit when the file is ready
  14. # for committing.
  15. # The file is relative to the srcdir.
  16. return ""
  17. }
  18. sub rcs_commit ($$$;$$) {
  19. # Tries to commit the page; returns undef on _success_ and
  20. # a version of the page with the rcs's conflict markers on failure.
  21. # The file is relative to the srcdir.
  22. my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
  23. return undef # success
  24. }
  25. sub rcs_commit_staged ($$$) {
  26. # Commits all staged changes. Changes can be staged using rcs_add,
  27. # rcs_remove, and rcs_rename.
  28. my ($message, $user, $ipaddr)=@_;
  29. return undef # success
  30. }
  31. sub rcs_add ($) {
  32. # Add a file. The filename is relative to the root of the srcdir.
  33. # Note that this should not check the new file in, it should only
  34. # prepare for it to be checked in when rcs_commit is called.
  35. # Note that the file may be in a new subdir that is not yet added
  36. # to version control; the subdir can be added if so.
  37. }
  38. sub rcs_remove ($) {
  39. # Remove a file. The filename is relative to the root of the srcdir.
  40. # Note that this should not check the removal in, it should only
  41. # prepare for it to be checked in when rcs_commit is called.
  42. # Note that the new file may be in a new subdir that is not yet added
  43. # to version control; the subdir can be added if so.
  44. }
  45. sub rcs_rename ($$) {
  46. # Rename a file. The filenames are relative to the root of the srcdir.
  47. # Note that this should not commit the rename, it should only
  48. # prepare it for when rcs_commit is called.
  49. # The new filename may be in a new subdir, that is not yet added to
  50. # version control. If so, the subdir will exist already, and should
  51. # be added.
  52. }
  53. sub rcs_recentchanges ($) {
  54. # Examine the RCS history and generate a list of recent changes.
  55. # The data structure returned for each change is:
  56. # {
  57. # rev => # the RCSs id for this commit
  58. # user => # name of user who made the change,
  59. # committype => # either "web" or the name of the rcs,
  60. # when => # time when the change was made,
  61. # message => [
  62. # { line => "commit message line" },
  63. # { line => "commit message line" },
  64. # # etc,
  65. # ],
  66. # pages => [
  67. # {
  68. # page => # name of page changed,
  69. # diffurl => # optional url to a diff showing
  70. # # the changes,
  71. # },
  72. # # repeat for each page changed in this commit,
  73. # ],
  74. # }
  75. }
  76. sub rcs_diff ($) {
  77. # Optional, used to get diffs for recentchanges.
  78. # The parameter is the rev from rcs_recentchanges.
  79. # Should return a list of lines of the diff (including \n) in list
  80. # context, and the whole diff in scalar context.
  81. }
  82. sub rcs_getctime ($) {
  83. # Optional, used to get the page creation time from the RCS.
  84. error gettext("getctime not implemented");
  85. }
  86. 1