Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cvs2cl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karl Fogel
cvs2cl
Commits
3606734f
Commit
3606734f
authored
26 years ago
by
Karl Fogel
Browse files
Options
Downloads
Patches
Plain Diff
Ooops, fixed the filename-resetting bug.
Added undocumented --debug flag and the debug() routine.
parent
52dd29c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cvs2cl.pl
+31
-9
31 additions, 9 deletions
cvs2cl.pl
with
31 additions
and
9 deletions
cvs2cl.pl
+
31
−
9
View file @
3606734f
...
...
@@ -69,6 +69,9 @@ $Version =~ s/\S+\s+(\S+)\s+\S+/$1/;
## Vars set by options:
# Print debugging messages?
my
$Debug
=
0
;
# Just show version and exit?
my
$Print_Version
=
0
;
...
...
@@ -143,7 +146,7 @@ sub derive_change_log ()
my
%grand_poobah
;
my
$file_
name
=
"";
my
$file_
full_path
=
"";
my
$date
=
"";
my
$author
=
"";
my
$msg_txt
=
"";
...
...
@@ -159,16 +162,16 @@ sub derive_change_log ()
while
(
<
LOG_SOURCE
>
)
{
# If on a new file and encounter the filename, grab it:
if
((
!
$file_
name
)
&&
(
!
$date
)
&&
(
!
$author
)
&&
(
!
$msg_txt
)
if
((
!
$file_
full_path
)
&&
(
!
$date
)
&&
(
!
$author
)
&&
(
!
$msg_txt
)
&&
/^Working file: (.*)/
)
{
$file_
name
=
$
1
;
$file_
full_path
=
$
1
;
next
;
}
# If have file name but not date or author, and see date or
# author, then grab them:
if
(
$file_
name
&&
(
!
$date
)
&&
(
!
$author
)
&&
/^date: .*/
)
{
if
(
$file_
full_path
&&
(
!
$date
)
&&
(
!
$author
)
&&
/^date: .*/
)
{
(
$date
,
$author
)
=
&parse_date_and_author
(
$_
);
next
;
}
...
...
@@ -180,7 +183,7 @@ sub derive_change_log ()
# If have file name, date, and author, then we're just grabbing
# log message texts:
if
(
$file_
name
&&
$date
&&
$author
)
if
(
$file_
full_path
&&
$date
&&
$author
)
{
unless
(
/^$logmsg_separator/
||
/^$file_separator/
)
{
...
...
@@ -213,12 +216,14 @@ sub derive_change_log ()
$date_author_text
.=
"
\n
$msg_txt
";
my
$dir_key
;
# key into %grand_poobah
my
$fname
;
# the file name we record under
my
$ignore_me
;
# why are you reading this?
if
(
$Distributed
)
{
(
$f
ile_
name
,
$dir_key
,
$ignore_me
)
=
fileparse
(
$file_
name
);
(
$fname
,
$dir_key
,
$ignore_me
)
=
fileparse
(
$file_
full_path
);
}
else
{
$dir_key
=
"
./
";
# just use current directory
$dir_key
=
"
./
";
$fname
=
$file_full_path
;
}
## Get the appropriate directory subhash
...
...
@@ -241,7 +246,8 @@ sub derive_change_log ()
}
# Add this file to the list
push
(
@$files_reffy
,
(
$file_name
));
debug
("
pushing msg for
$dir_key
,
$fname
\n
");
push
(
@$files_reffy
,
(
$fname
));
# Stuff everyone back into the glove compartment
$subhash
{
$date_author_text
}
=
$files_reffy
;
...
...
@@ -256,7 +262,7 @@ sub derive_change_log ()
# Maybe even make way for the next file:
if
(
/^$file_separator/
)
{
$file_
name
=
"";
$file_
full_path
=
"";
}
}
next
;
...
...
@@ -269,6 +275,8 @@ sub derive_change_log ()
foreach
my
$dir
(
keys
(
%grand_poobah
))
{
debug
("
DOING DIR:
$dir
\n
");
my
$tmpfile
=
"
${dir}${Log_File_Name}
.cvs2cl$$.tmp
";
my
$logfile_here
=
"
${dir}${Log_File_Name}
";
my
$logfile_bak
=
"
${dir}
.
${Log_File_Name}
.bak
";
...
...
@@ -294,6 +302,8 @@ sub derive_change_log ()
my
$files
=
&pretty_file_list
(
$filesref
);
$text
=
&pretty_msg_text
(
$text
);
debug
("
DOING
$dir
FILES:
$files
\n
");
# See page 512 of Perl Programming, 2nd Edition, about "wrap()":
print
LOG_OUT
"
$date_author
\n
";
print
LOG_OUT
"
\n
";
...
...
@@ -387,6 +397,9 @@ sub parse_options ()
if
(
$arg
=~
/^-h$|^-help$|^--help$|^--usage$|^-?$/
)
{
$Print_Usage
=
1
;
}
elsif
(
$arg
=~
/^--debug$/
)
{
# unadvertised option, heh
$Debug
=
1
;
}
elsif
(
$arg
=~
/^--version$/
)
{
$Print_Version
=
1
;
}
...
...
@@ -456,6 +469,15 @@ sub parse_options ()
}
sub
debug
()
{
if
(
$Debug
)
{
my
$msg
=
shift
;
print
STDERR
"
${msg}
";
}
}
sub
version
()
{
print
"
cvs2pl.cl version
${Version}
; distributed under the GNU GPL.
\n
";
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment