Skip to content

Instantly share code, notes, and snippets.

Jeremy, this is for your benefit. I wanted to follow Josh's advice with that patch that Peter just sent in.
Here was my workflow:
- git pull (make sure I'm up to date)
- git apply patch.txt
- del patch.txt
- rake
- git commit -a -m "blah blah"
- git pull
public class DiffTrees
{
private IList<Tree> trees = new List<Tree>();
public bool Recursive { get; set; }
public void AddTree(Tree tree)
{
trees.Add(tree);
}
public class DiffTreePort
{
private bool recursive;
public void AddTree(AbstractTreeIterator c)
{
trees.Add(c);
}
private List<AbstractTreeIterator> trees = new List<AbstractTreeIterator>();
// special interface for overriding automaps
public interface IMappingOverride<T>
{
void Override(AutoMap<T> mapping);
}
// special config chunk for using above
public class SupplyMappingOverridesChunk : IAutoMappingConfigChunk
{
private readonly Assembly assembly;
public interface IAutoMappingConfigChunk
{
void Configure(AutoPersistenceModel model);
}
// in AutoPersistenceModel
public AutoPersistenceModel WithConfigurationChunk(IAutoMappingConfigChunk chunk)
{
configChunks.Add(chunk);
return this;
using System.Reflection;
using FluentNHibernate.AutoMap;
using FluentNHibernate.Framework;
using MyApplication.Core.Domain;
namespace MyApplication.Core.Persistence
{
public class MyCustomPersistenceModel : AutoPersistenceModel
{
public MyCustomPersistenceModel()
Task<AddCosts>(task =>
task.Result<Done>()
.WhenSetting(Settings.HasMasterApproval)
.IsTrueGoto(MasterApprovalSequence)
.IsFalseGoto(NonMasterApprovalSequence));
Filename = LetterOrDigit+:name '.' LetterOrDigit+:ext -> { name.As<string>() + "." + ext.As<string>() }
| LetterOrDigit+:name -> { name.As<string>() },
FullFile = FileStats+:files -> { files },
protected IList<T> ParseList<T>(string text, Func<GitNumstatParser, Rule<char>> ruleFetcher)
{
return new List<T>(Grammars.ParseWith(text, ruleFetcher).ToIEnumerable<T>());
}