Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Mercurial extension like svn propset?

I need to attach custom metadata to my source files that at tracked via Mercurial. The svn properties commands are exactly what I need.

Is there a mercurial extension that provides commands similar to propset, propget, propdel, etc?

If there isn't an extension, why not?
Is there an alternative/better approach for custom metadata when using Mercurial?
Is custom metadata not useful to anyone else?
Is the extension dearly desired but just not written yet?

extra info: If it helps. The metadata I'm tracking is whether each file has been codereviewed, unittested, qa'd, etc. This data needs to be traceable and merges between branches/clones aren't fine grained enough.

like image 890
deft_code Avatar asked Dec 14 '10 20:12

deft_code


2 Answers

Mercurial's philosophy is that you track files and only files. You can't even check in an empty folder because Mercurial doesn't know about folders!

So, here are the answers:

  • I can't find any extension that does what you want. (You can write your own of course.)

  • The Mercurialful way to do what you want is to store the data in a flat file and use some scripts to process it. :(

It sounds like you've got a pretty well thought out system in place and good engineering practice at your company so I won't be pedantic here about it, but one can make a reasonable argument that your method does nothing except hurt portability. There's nothing magical about properties, I would just run an svn proplist -v . on your tree, dump that to hidden files -- something like .tracking -- just explicitly merge it along with your normal files. This doesn't really add any work since you have to merge properties anyway.

I hope that works for you!

like image 65
leoger Avatar answered Sep 22 '22 14:09

leoger


The Mercurial convention is to put files name .hg* into the root of the repository, and use them as dictionaries (of some kind) to map file names to property values. For example, instead of svn:eol-style the hgeol extension uses a .hgeol file.

In case of tracking code review, I'd recommend to write another extension that allows manipulation of this metadata, and have that extension store its state in a merge-friendly format.

like image 42
Martin v. Löwis Avatar answered Sep 21 '22 14:09

Martin v. Löwis