Change a comment in an SVN log (or fixing a malformed SVN log file after changing a comment)

Posted By: Brian Meloche; Posted At : December 10, 2009 1:46 PM

Related Categories: Subversion, Notes to Self

This post falls into the category of "self-reminders".

Several months back, I ran into an issue with a corrupt Subversion log entry while trying to update the comments in a log. I found this post then on what the problem was, and how to fix it:

svn: malformed file recovery

Back up for a minute... Why corrupt? How would that happen in the first place?

OK... let's say you post a comment when doing a commit, and you realize after committing that your comment was pertaining to the wrong fix, or you didn't make a comment and needed to, or did but you left something off. You can try to do this through your SVN GUI or maybe command line, but I've seen times where that change didn't work. You try to go into the repository manually, and you find where the logs are located, you find the revision and comment, change it, and... voila! Corrupt! You do a sanity check and discover that manual edit was the cause of the corruption. So, now what?

Let's take you through just that. Learn from my mistake!

Simply put, finding the revision comment in the log is easy enough to fix, assuming you have access to where the repository is stored (as opposed to access to the repository). Just go into your actual repository. You should find a "db" folder, then a revprops folder, and then a 0 folder and finally a file for the revision you want to change. On Windows, you should have something like this:

C:\{where my repositories are stored}\{repo name}\db\revprops\0\{revision number}

Assuming your comment hasn't been changed yet (it won't matter below), open that file, and you'll find the comment at line 12 that you want to change and change it.

Thought that was easy? Nope, not quite. Save the file, and then try to browse your repository log. You should now get a malformed file error message. If you had this before, you're probably snickering, as you're no farther ahead.

Now, go back to that revision number file that contains the log comment. See line 11? That should say V, then a space, and finally a number. That number is significant. That represents the number of characters in line 12. Count the number of characters on line 12 and replace the number on line 11. Save the file and try browsing the log again... problem fixed.

I thought this mental reminder would help others as much or more as it'll help me!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)

Hosting provided by...

Hosting provided by hostmysite.com

Calendar

<< March 2010 >>

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archives By Subject

  • About Me (41) [RSS]
  • ActionScript (1) [RSS]
  • Actuate (1) [RSS]
  • Adobe (16) [RSS]
  • Adobe Community Experts (2) [RSS]
  • AIR (1) [RSS]
  • AJAX (1) [RSS]
  • Animals (11) [RSS]
  • Articles (2) [RSS]
  • ASP (1) [RSS]
  • Blogging (14) [RSS]
  • BlueDragon (2) [RSS]
  • Canadian-American (1) [RSS]
  • CFConversations (16) [RSS]
  • Cleveland (3) [RSS]
  • Cleveland AUG (20) [RSS]
  • Cleveland CFUG (23) [RSS]
  • ColdFusion (75) [RSS]
  • Conferences (32) [RSS]
  • Design (3) [RSS]
  • Dreamweaver (1) [RSS]
  • Eclipse (1) [RSS]
  • Flash (2) [RSS]
  • Flex (10) [RSS]
  • Frameworks (6) [RSS]
  • Fusebox (1) [RSS]
  • J2EE (1) [RSS]
  • JavaScript (1) [RSS]
  • Jobs (2) [RSS]
  • LightFront (3) [RSS]
  • Linux (2) [RSS]
  • Mac (3) [RSS]
  • Mach-ii (8) [RSS]
  • Macromedia (9) [RSS]
  • MAX (34) [RSS]
  • Notes to Self (1) [RSS]
  • Open Source (6) [RSS]
  • Personal (16) [RSS]
  • Podcasts (23) [RSS]
  • Politics (1) [RSS]
  • Railo (0) [RSS]
  • Random Musings (10) [RSS]
  • Reality TV (1) [RSS]
  • Social Networking (1) [RSS]
  • Speaking (6) [RSS]
  • Subversion (2) [RSS]
  • Tech News (2) [RSS]
  • Technology (2) [RSS]
  • User Groups (21) [RSS]
  • Weight Loss (4) [RSS]
  • Windows (0) [RSS]
  • Work (8) [RSS]
  • Search

    Twitter Updates
    Follow me!

      RSS

      Subscribe

      Enter your email address to subscribe to this blog.

      Tags

      about me adobe animals blogging cfconversations cleveland aug cleveland cfug coldfusion conferences flex max personal podcasts random musings user groups

      Recent Comments

      Speaking at CFObjective 2010!!!
      Peter Bell said: Great - see you there! [More]

      Want a stripped down Eclipse? A 64-bit Eclipse? Get it here...
      Brian Meloche said: I don't use ANT on a regular basis. I may start but I don't currently use it within Eclipse. I've no... [More]

      Want a stripped down Eclipse? A 64-bit Eclipse? Get it here...
      Geoff said: Did you manage to get ANT working with just the basic platform version? I'm on Windows 7, 64bit, an... [More]

      LightFront: The incredibly simple & approachable MVC Framework for ColdFusion
      Brian Meloche said: Sean, my words made it seem otherwise, and that wasn't my intention. "Ties into" didn't me... [More]

      LightFront: The incredibly simple & approachable MVC Framework for ColdFusion
      Sean Corfield said: You said that FW/1 "ties into ColdSpring or Lightwire" and I want to clarify that it HAS N... [More]

      Podcasts I Listen To...

      Active Podcasts
      CFConversations (My Podcast)
      CFPanel (technically not a podcast, but close enough!)
      RIA Podcast
      CFHour()
      The Flex Show
      Non-active CF/Flex Podcasts (still worth a listen)
      ColdFusion Weekly
      The ColdFusion Podcast
      Helms and Peters Out Loud
      Other Podcasts
      This Week in Tech (TWiT)
      Windows Weekly with Paul Thurotte
      MacBreak Weekly
      Net @ Nite
      Slashdot Review
      Ruby on Rails Podcast (I'm not a Rails developer, but it's always a good idea to stay in touch with the competition!)
      Web Design Podcast from boagworld.com
      Practical Web Design Magazine