monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] fyi: format breakage on changeset branch


From: graydon hoare
Subject: [Monotone-devel] fyi: format breakage on changeset branch
Date: Fri, 29 Oct 2004 01:32:29 -0400
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

hi,

I recently changed the changeset branch's revision and changeset formats. since these formats are hashed to produce revision IDs, any change to them will invalidate changeset-branch databases you're working on. I'm sorry for having done this, but I wanted to get it out of the way before a "release", and it was pretty clear the existing format was too ugly to ship. I think it was also pretty clear that the branch was still not-perfectly-stable, so I hope this doesn't come as too much of a surprise to anyone. it ought to be the last time fiddling with the format, or nearly so.

the old format, if you'll recall the discussion, was somewhat heavily structured: lots of whitespace, colons, braces, indentation, etc. to make it totally obvious (mostly to myself, while coding) what was going on. now that it more or less works, I've taken the time to rewrite the printer and parser in a way which is much more aesthetically pleasing. changesets which used to look like this:

---snip---
change_set:
{
  paths:
  {
     rename_file:
     {
       src: "usr/bin/sh"
       dst: "usr/bin/foo"
     }
     delete_dir: "usr/bin"
     add_file: "tmp/foo/bar.txt"
  }
  deltas:
  {
    delta:
    {
      path: "tmp/foo/bar.txt"
      src: []
      dst: [71e0274f16cd68bdf9a2bf5743b86fcc1e597cdc]
    }
  }
}
---snip---

now read more like this:

---snip---
rename_file: "usr/bin/sh"
         to: "usr/bin/foo"

delete_dir: "usr/bin"

add_file: "tmp/foo/bar.txt"

patch: "tmp/foo/bar.txt"
 from: []
   to: [71e0274f16cd68bdf9a2bf5743b86fcc1e597cdc]
---snip---

which has less chatter and takes up much less vertical room. indeed, changesets and revisions are now just a tightened-up version of the old status/diff/commit summary messages. key/value pairs are collected together into stanzas, and each stanza is indented so the values align vertically. it's a predictable normal form, and reads pretty well, I think; as best as I can do while keeping the printer and parser very simple.

-graydon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]