[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Editing author names in RCS files
From: |
Mark D. Baushke |
Subject: |
Re: Editing author names in RCS files |
Date: |
Mon, 06 Dec 2004 16:47:56 -0800 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sylvain Beucler <address@hidden> writes:
> Hello,
>
> I would like to fix a problem that occured at Savannah. The issue is
> pretty much described here:
> http://lists.gnu.org/archive/html/savannah-hackers/2004-12/msg00061.html
>
> and to sum up, the logged username became uid##### instead of the
> actual username, for a few days about a year ago. For example, user
> "miles" became "uid65618":
> http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/filecache.el
>
> The mapping uid<->user can be found using /etc/passwd.
>
>
> We would like to write a script to fix these usernames. However,
> rcs(1) is not meant to do it; moreover, the various RCS parser I had a
> look at are more concerned about extracting revisions than making
> changes to the actual RCS file, when they are not beta versions.
>
> Various web and mailing list archive searches didn't help.
>
> What do you think is the best way to fix the RCS files? Of course,
> "manual editing" is valid, but I have the failing to expect a quicker
> way :)
Quicker? Hmmm...
find . -name \*,v -print0 \|
xargs -0 perl -i.bak -pane \
's,^(date\s+[0-9.]+;\s+author\s+)uid65618;(\s+state\s\S;$),$1miles;$2,g;'
Of course, I urge you to ensure that the repository is locked or
otherwise not actively being modified when you run the script.
I would suggest performing the initial runs of the script on a snapshot
of the repository and then doing a comparison of the .bak files with
the original versions to ensure everything looks correct.
Good luck,
-- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQFBtP283x41pRYZE/gRAsXFAJwO9JwHz6EB20+x+uSsZeydwZzgXgCfS2q+
7JQByY/HSGNFDmdZBn/i3B8=
=j5z/
-----END PGP SIGNATURE-----