@noldova/checkpoints.git.linux-arm64 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +11 -2
  3. package/git/bin/git +0 -0
  4. package/git/bin/scalar +0 -0
  5. package/git/etc/gitconfig +13 -0
  6. package/git/libexec/git-core/git +0 -0
  7. package/git/libexec/git-core/git-archimport +1136 -0
  8. package/git/libexec/git-core/git-cvsexportcommit +469 -0
  9. package/git/libexec/git-core/git-cvsimport +1185 -0
  10. package/git/libexec/git-core/git-cvsserver +5109 -0
  11. package/git/libexec/git-core/git-daemon +0 -0
  12. package/git/libexec/git-core/git-difftool--helper +125 -0
  13. package/git/libexec/git-core/git-filter-branch +665 -0
  14. package/git/libexec/git-core/git-http-backend +0 -0
  15. package/git/libexec/git-core/git-http-fetch +0 -0
  16. package/git/libexec/git-core/git-imap-send +0 -0
  17. package/git/libexec/git-core/git-instaweb +786 -0
  18. package/git/libexec/git-core/git-merge-octopus +112 -0
  19. package/git/libexec/git-core/git-merge-one-file +167 -0
  20. package/git/libexec/git-core/git-merge-resolve +64 -0
  21. package/git/libexec/git-core/git-mergetool +579 -0
  22. package/git/libexec/git-core/git-mergetool--lib +549 -0
  23. package/git/libexec/git-core/git-quiltimport +155 -0
  24. package/git/libexec/git-core/git-receive-pack +0 -0
  25. package/git/libexec/git-core/git-remote-ftp +0 -0
  26. package/git/libexec/git-core/git-remote-ftps +0 -0
  27. package/git/libexec/git-core/git-remote-http +0 -0
  28. package/git/libexec/git-core/git-remote-https +0 -0
  29. package/git/libexec/git-core/git-request-pull +178 -0
  30. package/git/libexec/git-core/git-send-email +2474 -0
  31. package/git/libexec/git-core/git-sh-i18n +79 -0
  32. package/git/libexec/git-core/git-sh-i18n--envsubst +0 -0
  33. package/git/libexec/git-core/git-sh-setup +357 -0
  34. package/git/libexec/git-core/git-shell +0 -0
  35. package/git/libexec/git-core/git-submodule +671 -0
  36. package/git/libexec/git-core/git-upload-archive +0 -0
  37. package/git/libexec/git-core/git-upload-pack +0 -0
  38. package/git/libexec/git-core/git-web--browse +196 -0
  39. package/git/libexec/git-core/mergetools/araxis +26 -0
  40. package/git/libexec/git-core/mergetools/bc +37 -0
  41. package/git/libexec/git-core/mergetools/codecompare +31 -0
  42. package/git/libexec/git-core/mergetools/deltawalker +33 -0
  43. package/git/libexec/git-core/mergetools/diffmerge +26 -0
  44. package/git/libexec/git-core/mergetools/diffuse +23 -0
  45. package/git/libexec/git-core/mergetools/ecmerge +22 -0
  46. package/git/libexec/git-core/mergetools/emerge +34 -0
  47. package/git/libexec/git-core/mergetools/examdiff +24 -0
  48. package/git/libexec/git-core/mergetools/guiffy +26 -0
  49. package/git/libexec/git-core/mergetools/gvimdiff +1 -0
  50. package/git/libexec/git-core/mergetools/kdiff3 +44 -0
  51. package/git/libexec/git-core/mergetools/kompare +19 -0
  52. package/git/libexec/git-core/mergetools/meld +97 -0
  53. package/git/libexec/git-core/mergetools/nvimdiff +1 -0
  54. package/git/libexec/git-core/mergetools/opendiff +22 -0
  55. package/git/libexec/git-core/mergetools/p4merge +44 -0
  56. package/git/libexec/git-core/mergetools/smerge +20 -0
  57. package/git/libexec/git-core/mergetools/tkdiff +24 -0
  58. package/git/libexec/git-core/mergetools/tortoisemerge +40 -0
  59. package/git/libexec/git-core/mergetools/vimdiff +657 -0
  60. package/git/libexec/git-core/mergetools/vscode +19 -0
  61. package/git/libexec/git-core/mergetools/winmerge +23 -0
  62. package/git/libexec/git-core/mergetools/xxdiff +38 -0
  63. package/git/libexec/git-core/scalar +0 -0
  64. package/git/share/bash-completion/completions/git +4115 -0
  65. package/git/share/git-core/templates/description +1 -0
  66. package/git/share/git-core/templates/hooks/applypatch-msg.sample +15 -0
  67. package/git/share/git-core/templates/hooks/commit-msg.sample +74 -0
  68. package/git/share/git-core/templates/hooks/fsmonitor-watchman.sample +168 -0
  69. package/git/share/git-core/templates/hooks/post-update.sample +8 -0
  70. package/git/share/git-core/templates/hooks/pre-applypatch.sample +14 -0
  71. package/git/share/git-core/templates/hooks/pre-commit.sample +49 -0
  72. package/git/share/git-core/templates/hooks/pre-merge-commit.sample +13 -0
  73. package/git/share/git-core/templates/hooks/pre-push.sample +53 -0
  74. package/git/share/git-core/templates/hooks/pre-rebase.sample +169 -0
  75. package/git/share/git-core/templates/hooks/pre-receive.sample +24 -0
  76. package/git/share/git-core/templates/hooks/prepare-commit-msg.sample +42 -0
  77. package/git/share/git-core/templates/hooks/push-to-checkout.sample +78 -0
  78. package/git/share/git-core/templates/hooks/sendemail-validate.sample +77 -0
  79. package/git/share/git-core/templates/hooks/update.sample +128 -0
  80. package/git/share/git-core/templates/info/exclude +6 -0
  81. package/git/share/gitweb/gitweb.cgi +8499 -0
  82. package/git/share/gitweb/static/git-favicon.png +0 -0
  83. package/git/share/gitweb/static/git-logo.png +0 -0
  84. package/git/share/gitweb/static/gitweb.css +756 -0
  85. package/git/share/gitweb/static/gitweb.js +1579 -0
  86. package/git/share/locale/af/LC_MESSAGES/git.mo +0 -0
  87. package/git/share/locale/bg/LC_MESSAGES/git.mo +0 -0
  88. package/git/share/locale/ca/LC_MESSAGES/git.mo +0 -0
  89. package/git/share/locale/de/LC_MESSAGES/git.mo +0 -0
  90. package/git/share/locale/el/LC_MESSAGES/git.mo +0 -0
  91. package/git/share/locale/es/LC_MESSAGES/git.mo +0 -0
  92. package/git/share/locale/fr/LC_MESSAGES/git.mo +0 -0
  93. package/git/share/locale/ga/LC_MESSAGES/git.mo +0 -0
  94. package/git/share/locale/id/LC_MESSAGES/git.mo +0 -0
  95. package/git/share/locale/is/LC_MESSAGES/git.mo +0 -0
  96. package/git/share/locale/it/LC_MESSAGES/git.mo +0 -0
  97. package/git/share/locale/ko/LC_MESSAGES/git.mo +0 -0
  98. package/git/share/locale/pl/LC_MESSAGES/git.mo +0 -0
  99. package/git/share/locale/pt_BR/LC_MESSAGES/git.mo +0 -0
  100. package/git/share/locale/pt_PT/LC_MESSAGES/git.mo +0 -0
  101. package/git/share/locale/ru/LC_MESSAGES/git.mo +0 -0
  102. package/git/share/locale/sv/LC_MESSAGES/git.mo +0 -0
  103. package/git/share/locale/tr/LC_MESSAGES/git.mo +0 -0
  104. package/git/share/locale/uk/LC_MESSAGES/git.mo +0 -0
  105. package/git/share/locale/vi/LC_MESSAGES/git.mo +0 -0
  106. package/git/share/locale/zh_CN/LC_MESSAGES/git.mo +0 -0
  107. package/git/share/locale/zh_TW/LC_MESSAGES/git.mo +0 -0
  108. package/git/share/perl5/FromCPAN/Error.pm +1040 -0
  109. package/git/share/perl5/FromCPAN/Mail/Address.pm +280 -0
  110. package/git/share/perl5/Git/I18N.pm +125 -0
  111. package/git/share/perl5/Git/IndexInfo.pm +35 -0
  112. package/git/share/perl5/Git/LoadCPAN/Error.pm +10 -0
  113. package/git/share/perl5/Git/LoadCPAN/Mail/Address.pm +10 -0
  114. package/git/share/perl5/Git/LoadCPAN.pm +104 -0
  115. package/git/share/perl5/Git/Packet.pm +173 -0
  116. package/git/share/perl5/Git/SVN/Editor.pm +605 -0
  117. package/git/share/perl5/Git/SVN/Fetcher.pm +622 -0
  118. package/git/share/perl5/Git/SVN/GlobSpec.pm +65 -0
  119. package/git/share/perl5/Git/SVN/Log.pm +400 -0
  120. package/git/share/perl5/Git/SVN/Memoize/YAML.pm +93 -0
  121. package/git/share/perl5/Git/SVN/Migration.pm +265 -0
  122. package/git/share/perl5/Git/SVN/Prompt.pm +184 -0
  123. package/git/share/perl5/Git/SVN/Ra.pm +708 -0
  124. package/git/share/perl5/Git/SVN/Utils.pm +232 -0
  125. package/git/share/perl5/Git/SVN.pm +2573 -0
  126. package/git/share/perl5/Git.pm +1780 -0
  127. package/licenses/git/COPYING +360 -0
  128. package/licenses/git/LGPL-2.1 +511 -0
  129. package/licenses/perl-modules-from-cpan/Artistic +131 -0
  130. package/licenses/perl-modules-from-cpan/Copying +250 -0
  131. package/package.json +167 -4
@@ -0,0 +1,400 @@
1
+ package Git::SVN::Log;
2
+ use strict;
3
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
4
+ use Git::SVN::Utils qw(fatal);
5
+ use Git qw(command
6
+ command_oneline
7
+ command_output_pipe
8
+ command_close_pipe
9
+ get_tz_offset);
10
+ use POSIX qw/strftime/;
11
+ use constant commit_log_separator => ('-' x 72) . "\n";
12
+ use vars qw/$TZ $limit $color $pager $non_recursive $verbose $oneline
13
+ %rusers $show_commit $incremental/;
14
+
15
+ # Option set in git-svn
16
+ our $_git_format;
17
+
18
+ sub cmt_showable {
19
+ my ($c) = @_;
20
+ return 1 if defined $c->{r};
21
+
22
+ # big commit message got truncated by the 16k pretty buffer in rev-list
23
+ if ($c->{l} && $c->{l}->[-1] eq "...\n" &&
24
+ $c->{a_raw} =~ /\@([a-f\d\-]+)>$/) {
25
+ @{$c->{l}} = ();
26
+ my @log = command(qw/cat-file commit/, $c->{c});
27
+
28
+ # shift off the headers
29
+ shift @log while ($log[0] ne '');
30
+ shift @log;
31
+
32
+ # TODO: make $c->{l} not have a trailing newline in the future
33
+ @{$c->{l}} = map { "$_\n" } grep !/^git-svn-id: /, @log;
34
+
35
+ (undef, $c->{r}, undef) = ::extract_metadata(
36
+ (grep(/^git-svn-id: /, @log))[-1]);
37
+ }
38
+ return defined $c->{r};
39
+ }
40
+
41
+ sub log_use_color {
42
+ return $color || Git->repository->get_colorbool('color.diff');
43
+ }
44
+
45
+ sub git_svn_log_cmd {
46
+ my ($r_min, $r_max, @args) = @_;
47
+ my $head = 'HEAD';
48
+ my (@files, @log_opts);
49
+ foreach my $x (@args) {
50
+ if ($x eq '--' || @files) {
51
+ push @files, $x;
52
+ } else {
53
+ if (::verify_ref("$x^0")) {
54
+ $head = $x;
55
+ } else {
56
+ push @log_opts, $x;
57
+ }
58
+ }
59
+ }
60
+
61
+ my ($url, $rev, $uuid, $gs) = ::working_head_info($head);
62
+
63
+ require Git::SVN;
64
+ $gs ||= Git::SVN->_new;
65
+ my @cmd = (qw/log --abbrev-commit --pretty=raw --default/,
66
+ $gs->refname);
67
+ push @cmd, '-r' unless $non_recursive;
68
+ push @cmd, qw/--raw --name-status/ if $verbose;
69
+ push @cmd, '--color' if log_use_color();
70
+ push @cmd, @log_opts;
71
+ if (defined $r_max && $r_max == $r_min) {
72
+ push @cmd, '--max-count=1';
73
+ if (my $c = $gs->rev_map_get($r_max)) {
74
+ push @cmd, $c;
75
+ }
76
+ } elsif (defined $r_max) {
77
+ if ($r_max < $r_min) {
78
+ ($r_min, $r_max) = ($r_max, $r_min);
79
+ }
80
+ my (undef, $c_max) = $gs->find_rev_before($r_max, 1, $r_min);
81
+ my (undef, $c_min) = $gs->find_rev_after($r_min, 1, $r_max);
82
+ # If there are no commits in the range, both $c_max and $c_min
83
+ # will be undefined. If there is at least 1 commit in the
84
+ # range, both will be defined.
85
+ return () if !defined $c_min || !defined $c_max;
86
+ if ($c_min eq $c_max) {
87
+ push @cmd, '--max-count=1', $c_min;
88
+ } else {
89
+ push @cmd, '--boundary', "$c_min..$c_max";
90
+ }
91
+ }
92
+ return (@cmd, @files);
93
+ }
94
+
95
+ # adapted from pager.c
96
+ sub config_pager {
97
+ if (! -t *STDOUT) {
98
+ $ENV{GIT_PAGER_IN_USE} = 'false';
99
+ $pager = undef;
100
+ return;
101
+ }
102
+ chomp($pager = command_oneline(qw(var GIT_PAGER)));
103
+ if ($pager eq 'cat') {
104
+ $pager = undef;
105
+ }
106
+ $ENV{GIT_PAGER_IN_USE} = defined($pager);
107
+ }
108
+
109
+ sub run_pager {
110
+ return unless defined $pager;
111
+ pipe my ($rfd, $wfd) or return;
112
+ defined(my $pid = fork) or fatal "Can't fork: $!";
113
+ if (!$pid) {
114
+ open STDOUT, '>&', $wfd or
115
+ fatal "Can't redirect to stdout: $!";
116
+ return;
117
+ }
118
+ open STDIN, '<&', $rfd or fatal "Can't redirect stdin: $!";
119
+ $ENV{LESS} ||= 'FRX';
120
+ $ENV{LV} ||= '-c';
121
+ exec $pager or fatal "Can't run pager: $! ($pager)";
122
+ }
123
+
124
+ sub format_svn_date {
125
+ my $t = shift || time;
126
+ require Git::SVN;
127
+ my $gmoff = get_tz_offset($t);
128
+ return strftime("%Y-%m-%d %H:%M:%S $gmoff (%a, %d %b %Y)", localtime($t));
129
+ }
130
+
131
+ sub parse_git_date {
132
+ my ($t, $tz) = @_;
133
+ # Date::Parse isn't in the standard Perl distro :(
134
+ if ($tz =~ s/^\+//) {
135
+ $t += tz_to_s_offset($tz);
136
+ } elsif ($tz =~ s/^\-//) {
137
+ $t -= tz_to_s_offset($tz);
138
+ }
139
+ return $t;
140
+ }
141
+
142
+ sub set_local_timezone {
143
+ if (defined $TZ) {
144
+ $ENV{TZ} = $TZ;
145
+ } else {
146
+ delete $ENV{TZ};
147
+ }
148
+ }
149
+
150
+ sub tz_to_s_offset {
151
+ my ($tz) = @_;
152
+ $tz =~ s/(\d\d)$//;
153
+ return ($1 * 60) + ($tz * 3600);
154
+ }
155
+
156
+ sub get_author_info {
157
+ my ($dest, $author, $t, $tz) = @_;
158
+ $author =~ s/(?:^\s*|\s*$)//g;
159
+ $dest->{a_raw} = $author;
160
+ my $au;
161
+ if ($::_authors) {
162
+ $au = $rusers{$author} || undef;
163
+ }
164
+ if (!$au) {
165
+ ($au) = ($author =~ /<([^>]+)\@[^>]+>$/);
166
+ }
167
+ $dest->{t} = $t;
168
+ $dest->{tz} = $tz;
169
+ $dest->{a} = $au;
170
+ $dest->{t_utc} = parse_git_date($t, $tz);
171
+ }
172
+
173
+ sub process_commit {
174
+ my ($c, $r_min, $r_max, $defer) = @_;
175
+ if (defined $r_min && defined $r_max) {
176
+ if ($r_min == $c->{r} && $r_min == $r_max) {
177
+ show_commit($c);
178
+ return 0;
179
+ }
180
+ return 1 if $r_min == $r_max;
181
+ if ($r_min < $r_max) {
182
+ # we need to reverse the print order
183
+ return 0 if (defined $limit && --$limit < 0);
184
+ push @$defer, $c;
185
+ return 1;
186
+ }
187
+ if ($r_min != $r_max) {
188
+ return 1 if ($r_min < $c->{r});
189
+ return 1 if ($r_max > $c->{r});
190
+ }
191
+ }
192
+ return 0 if (defined $limit && --$limit < 0);
193
+ show_commit($c);
194
+ return 1;
195
+ }
196
+
197
+ my $l_fmt;
198
+ sub show_commit {
199
+ my $c = shift;
200
+ if ($oneline) {
201
+ my $x = "\n";
202
+ if (my $l = $c->{l}) {
203
+ while ($l->[0] =~ /^\s*$/) { shift @$l }
204
+ $x = $l->[0];
205
+ }
206
+ $l_fmt ||= 'A' . length($c->{r});
207
+ print 'r',pack($l_fmt, $c->{r}),' | ';
208
+ print "$c->{c} | " if $show_commit;
209
+ print $x;
210
+ } else {
211
+ show_commit_normal($c);
212
+ }
213
+ }
214
+
215
+ sub show_commit_changed_paths {
216
+ my ($c) = @_;
217
+ return unless $c->{changed};
218
+ print "Changed paths:\n", @{$c->{changed}};
219
+ }
220
+
221
+ sub show_commit_normal {
222
+ my ($c) = @_;
223
+ print commit_log_separator, "r$c->{r} | ";
224
+ print "$c->{c} | " if $show_commit;
225
+ print "$c->{a} | ", format_svn_date($c->{t_utc}), ' | ';
226
+ my $nr_line = 0;
227
+
228
+ if (my $l = $c->{l}) {
229
+ while ($l->[$#$l] eq "\n" && $#$l > 0
230
+ && $l->[($#$l - 1)] eq "\n") {
231
+ pop @$l;
232
+ }
233
+ $nr_line = scalar @$l;
234
+ if (!$nr_line) {
235
+ print "1 line\n\n\n";
236
+ } else {
237
+ if ($nr_line == 1) {
238
+ $nr_line = '1 line';
239
+ } else {
240
+ $nr_line .= ' lines';
241
+ }
242
+ print $nr_line, "\n";
243
+ show_commit_changed_paths($c);
244
+ print "\n";
245
+ print $_ foreach @$l;
246
+ }
247
+ } else {
248
+ print "1 line\n";
249
+ show_commit_changed_paths($c);
250
+ print "\n";
251
+
252
+ }
253
+ foreach my $x (qw/raw stat diff/) {
254
+ if ($c->{$x}) {
255
+ print "\n";
256
+ print $_ foreach @{$c->{$x}}
257
+ }
258
+ }
259
+ }
260
+
261
+ sub cmd_show_log {
262
+ my (@args) = @_;
263
+ my ($r_min, $r_max);
264
+ my $r_last = -1; # prevent dupes
265
+ set_local_timezone();
266
+ if (defined $::_revision) {
267
+ if ($::_revision =~ /^(\d+):(\d+)$/) {
268
+ ($r_min, $r_max) = ($1, $2);
269
+ } elsif ($::_revision =~ /^\d+$/) {
270
+ $r_min = $r_max = $::_revision;
271
+ } else {
272
+ fatal "-r$::_revision is not supported, use ",
273
+ "standard 'git log' arguments instead";
274
+ }
275
+ }
276
+
277
+ config_pager();
278
+ @args = git_svn_log_cmd($r_min, $r_max, @args);
279
+ if (!@args) {
280
+ print commit_log_separator unless $incremental || $oneline;
281
+ return;
282
+ }
283
+ my $log = command_output_pipe(@args);
284
+ run_pager();
285
+ my (@k, $c, $d, $stat);
286
+ my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
287
+ while (<$log>) {
288
+ if (/^${esc_color}commit (?:- )?($::oid_short)/o) {
289
+ my $cmt = $1;
290
+ if ($c && cmt_showable($c) && $c->{r} != $r_last) {
291
+ $r_last = $c->{r};
292
+ process_commit($c, $r_min, $r_max, \@k) or
293
+ goto out;
294
+ }
295
+ $d = undef;
296
+ $c = { c => $cmt };
297
+ } elsif (/^${esc_color}author (.+) (\d+) ([\-\+]?\d+)$/o) {
298
+ get_author_info($c, $1, $2, $3);
299
+ } elsif (/^${esc_color}(?:tree|parent|committer) /o) {
300
+ # ignore
301
+ } elsif (/^${esc_color}:\d{6} \d{6} $::oid_short/o) {
302
+ push @{$c->{raw}}, $_;
303
+ } elsif (/^${esc_color}[ACRMDT]\t/) {
304
+ # we could add $SVN->{svn_path} here, but that requires
305
+ # remote access at the moment (repo_path_split)...
306
+ s#^(${esc_color})([ACRMDT])\t#$1 $2 #o;
307
+ push @{$c->{changed}}, $_;
308
+ } elsif (/^${esc_color}diff /o) {
309
+ $d = 1;
310
+ push @{$c->{diff}}, $_;
311
+ } elsif ($d) {
312
+ push @{$c->{diff}}, $_;
313
+ } elsif (/^\ .+\ \|\s*\d+\ $esc_color[\+\-]*
314
+ $esc_color*[\+\-]*$esc_color$/x) {
315
+ $stat = 1;
316
+ push @{$c->{stat}}, $_;
317
+ } elsif ($stat && /^ \d+ files changed, \d+ insertions/) {
318
+ push @{$c->{stat}}, $_;
319
+ $stat = undef;
320
+ } elsif (/^${esc_color} (git-svn-id:.+)$/o) {
321
+ ($c->{url}, $c->{r}, undef) = ::extract_metadata($1);
322
+ } elsif (s/^${esc_color} //o) {
323
+ push @{$c->{l}}, $_;
324
+ }
325
+ }
326
+ if ($c && defined $c->{r} && $c->{r} != $r_last) {
327
+ $r_last = $c->{r};
328
+ process_commit($c, $r_min, $r_max, \@k);
329
+ }
330
+ if (@k) {
331
+ ($r_min, $r_max) = ($r_max, $r_min);
332
+ process_commit($_, $r_min, $r_max) foreach reverse @k;
333
+ }
334
+ out:
335
+ close $log;
336
+ print commit_log_separator unless $incremental || $oneline;
337
+ }
338
+
339
+ sub cmd_blame {
340
+ my $path = pop;
341
+
342
+ config_pager();
343
+ run_pager();
344
+
345
+ my ($fh, $ctx, $rev);
346
+
347
+ if ($_git_format) {
348
+ ($fh, $ctx) = command_output_pipe('blame', @_, $path);
349
+ while (my $line = <$fh>) {
350
+ if ($line =~ /^\^?([[:xdigit:]]+)\s/) {
351
+ # Uncommitted edits show up as a rev ID of
352
+ # all zeros, which we can't look up with
353
+ # cmt_metadata
354
+ if ($1 !~ /^0+$/) {
355
+ (undef, $rev, undef) =
356
+ ::cmt_metadata($1);
357
+ $rev = '0' if (!$rev);
358
+ } else {
359
+ $rev = '0';
360
+ }
361
+ $rev = sprintf('%-10s', $rev);
362
+ $line =~ s/^\^?[[:xdigit:]]+(\s)/$rev$1/;
363
+ }
364
+ print $line;
365
+ }
366
+ } else {
367
+ ($fh, $ctx) = command_output_pipe('blame', '-p', @_, 'HEAD',
368
+ '--', $path);
369
+ my ($sha1);
370
+ my %authors;
371
+ my @buffer;
372
+ my %dsha; #distinct sha keys
373
+
374
+ while (my $line = <$fh>) {
375
+ push @buffer, $line;
376
+ if ($line =~ /^([[:xdigit:]]{40})\s\d+\s\d+/) {
377
+ $dsha{$1} = 1;
378
+ }
379
+ }
380
+
381
+ my $s2r = ::cmt_sha2rev_batch([keys %dsha]);
382
+
383
+ foreach my $line (@buffer) {
384
+ if ($line =~ /^([[:xdigit:]]{40})\s\d+\s\d+/) {
385
+ $rev = $s2r->{$1};
386
+ $rev = '0' if (!$rev)
387
+ }
388
+ elsif ($line =~ /^author (.*)/) {
389
+ $authors{$rev} = $1;
390
+ $authors{$rev} =~ s/\s/_/g;
391
+ }
392
+ elsif ($line =~ /^\t(.*)$/) {
393
+ printf("%6s %10s %s\n", $rev, $authors{$rev}, $1);
394
+ }
395
+ }
396
+ }
397
+ command_close_pipe($fh, $ctx);
398
+ }
399
+
400
+ 1;
@@ -0,0 +1,93 @@
1
+ package Git::SVN::Memoize::YAML;
2
+ use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
3
+ use strict;
4
+ use YAML::Any ();
5
+
6
+ # based on Memoize::Storable.
7
+
8
+ sub TIEHASH {
9
+ my $package = shift;
10
+ my $filename = shift;
11
+ my $truehash = (-e $filename) ? YAML::Any::LoadFile($filename) : {};
12
+ my $self = {FILENAME => $filename, H => $truehash};
13
+ bless $self => $package;
14
+ }
15
+
16
+ sub STORE {
17
+ my $self = shift;
18
+ $self->{H}{$_[0]} = $_[1];
19
+ }
20
+
21
+ sub FETCH {
22
+ my $self = shift;
23
+ $self->{H}{$_[0]};
24
+ }
25
+
26
+ sub EXISTS {
27
+ my $self = shift;
28
+ exists $self->{H}{$_[0]};
29
+ }
30
+
31
+ sub DESTROY {
32
+ my $self = shift;
33
+ YAML::Any::DumpFile($self->{FILENAME}, $self->{H});
34
+ }
35
+
36
+ sub SCALAR {
37
+ my $self = shift;
38
+ scalar(%{$self->{H}});
39
+ }
40
+
41
+ sub FIRSTKEY {
42
+ 'Fake hash from Git::SVN::Memoize::YAML';
43
+ }
44
+
45
+ sub NEXTKEY {
46
+ undef;
47
+ }
48
+
49
+ 1;
50
+ __END__
51
+
52
+ =head1 NAME
53
+
54
+ Git::SVN::Memoize::YAML - store Memoized data in YAML format
55
+
56
+ =head1 SYNOPSIS
57
+
58
+ use Memoize;
59
+ use Git::SVN::Memoize::YAML;
60
+
61
+ tie my %cache => 'Git::SVN::Memoize::YAML', $filename;
62
+ memoize('slow_function', SCALAR_CACHE => [HASH => \%cache]);
63
+ slow_function(arguments);
64
+
65
+ =head1 DESCRIPTION
66
+
67
+ This module provides a class that can be used to tie a hash to a
68
+ YAML file. The file is read when the hash is initialized and
69
+ rewritten when the hash is destroyed.
70
+
71
+ The intent is to allow L<Memoize> to back its cache with a file in
72
+ YAML format, just like L<Memoize::Storable> allows L<Memoize> to
73
+ back its cache with a file in Storable format. Unlike the Storable
74
+ format, the YAML format is platform-independent and fairly stable.
75
+
76
+ Carps on error.
77
+
78
+ =head1 DIAGNOSTICS
79
+
80
+ See L<YAML::Any>.
81
+
82
+ =head1 DEPENDENCIES
83
+
84
+ L<YAML::Any> from CPAN.
85
+
86
+ =head1 INCOMPATIBILITIES
87
+
88
+ None reported.
89
+
90
+ =head1 BUGS
91
+
92
+ The entire cache is read into a Perl hash when loading the file,
93
+ so this is not very scalable.