For a while now I've been using subversion for my personal projects.
More and more I keep hearing great things about Git and Mercurial, and DVCS in general.
I'd like to give the whole DVCS thing a whirl, but I'm not too familiar with either option.
What are some of the differences between Mercurial and Git?
Note that I'm not trying to find out which one is "best" or even which one I should start with. I'm mainly looking for key areas where they are similar and where they are different, because I am interested to know how they differ in terms of implementation and philosophy.
We are evaluating IoC containers for C# projects, and both Unity and Castle.Windsor are standing out. One thing that I like about Unity (NInject and StructureMap also do this) is that types where it is obvious how to construct them do not have to be registered with the IoC Container.
Is there way to do this in Castle.Windsor? Am I being fair to Castle.Windsor to say that it does not do this? Is there a design reason to deliberately not do this, or is it an oversight, or just not seen as important or useful?
I am aware of container.Register(AllTypes... in Windsor but that's not quite the same thing. It's not entirely automatic, and it's very broad.
To illustrate the point, here are two NUnit tests doing the same thing via Unity and Castle.Windsor. The Castle.Windsor one fails. :
namespace SimpleIocDemo
{
using NUnit.Framework;
using Castle.Windsor;
using Microsoft.Practices.Unity;
public interface ISomeService
{
string DoSomething();
}
public class ServiceImplementation : ISomeService
{
public string DoSomething()
{
return "Hello";
}
}
public class RootObject
{
public ISomeService SomeService { get; private set; }
public RootObject(ISomeService service)
{
SomeService = service;
}
}
[TestFixture]
public class IocTests
{
[Test]
public void UnityResolveTest()
{
UnityContainer container = new UnityContainer();
container.RegisterType<ISomeService, ServiceImplementation>();
// Root object needs no registration in Unity
RootObject rootObject = container.Resolve<RootObject>();
Assert.AreEqual("Hello", rootObject.SomeService.DoSomething());
}
[Test]
public void WindsorResolveTest()
{
WindsorContainer container = new WindsorContainer();
container.AddComponent<ISomeService, ServiceImplementation>();
// fails with exception "Castle.MicroKernel.ComponentNotFoundException:
// No component for supporting the service SimpleIocDemo.RootObject was found"
// I could add
// container.AddComponent<RootObject>();
// but that approach does not scale
RootObject rootObject = container.Resolve<RootObject>();
Assert.AreEqual("Hello", rootObject.SomeService.DoSomething());
}
}
}
I first want to say I've read the Subversion manual. I've read this question. I've also read this question. Here's my dilemma.
Let's say I have 3 repositories laid out like this:
DataAccessObject/
branches/
tags/
trunk/
DataAccessObject/
DataAccessObjectTests/
PlanObject/
branches/
tags/
trunk/
PlanObject/
PlanObjectTests/
WinFormsPlanViewer/
branches/
tags/
trunk/
WinFormsPlanViewer/
The PlanObject and DataAccessObject repositories contain shared projects. They are used by the WinFormsPlanViewer, but also by several other projects in several other repositories.
Bear with me here. I put an svn:externals definition on the WinFormsPlanViewer/trunk folder like this:
https://server/svn/PlanObject/trunk Objects
https://server/svn/DataAccessObject/trunk Objects
And here's what I see after I do an svn update.
WinFormsPlanViewer/
branches/
tags/
trunk/
WinFormsPlanViewer/
Objects/
DataAccessObject/
DataAccessObjectTests/
The PlanObject stuff doesn't even come down in the update! I don't know if this has anything to do with it, but there's an externals definition on the PlanObject/trunk folder also:
https://server/svn/DataAccessObject/trunk Objects
What's going on here? What am I doing wrong? Are there bad consequences of referencing the PlanObject and the DataAccessObject from the WinFormsPlanViewer using svn:externals when the PlanObject references the DataAccessObject using svn:externals also?
A lot of people like git (in particular this guy) against other SCMs such as SVN, but many projects, even new ones, are set up using alternative SCMs. Furthermore, Google Code still does not support it (although many of their large open source projects use it).
My question is: what are the reasons for not using git in any project, whether it be personal or collaborative? Maybe I've just been brainwashed by this guy, but I can't see any area in which other SCMs excel over git.
I want to run scheduled nightly exports of my database code into my SVN source.
It's easy to schedule automated check-in's into svn from a folder, but scheduling the export from SQL in SQL Management Studio is
Right click target database, choose Tasks Generate Scripts.
Follow the wizard and presto you've got scripts in a folder.
Is it possible to extract a single script that the wizard generates, and stuff that into a stored proc which I can run nightly?
Ideas?
I'm using Netbeans to develop with Drupal. I'm trying to let Netbeans get drupal core and modules from the repository on drupal.org to my local working copy. Problem is: I already have a working copy that is not versioned yet.
When I try to checkout a copy from drupal.org, Netbeans asks if I want to create a new project - I don't. How can I turn my local copy into a "checked out" working copy?
In my project I register many ISerializers implementations with the assembly scanner. FWIW this is the code that registers my ISerializers
Scan(scanner =>
{
scanner.AssemblyContainingType<ISerializer>();
scanner.AddAllTypesOf<ISerializer>().NameBy(type => type.Name);
scanner.WithDefaultConventions();
});
Which then correctly registers
ISerializer (...ISerializer)
Scoped as: Transient
JsonSerializer Configured Instance of ...JsonSerializer
BsonSerializer Configured Instance of ...BsonSerializer
And so forth.
Currently the only way I've been able to figure out how to resolve the serializer I want is to hardcode a service location call with
jsonSerializer = ObjectFactory.GetNamedInstance<ISerializer>("JsonSerializer");
Now I know in my class that I specifically want the jsonSerializer so is there a way to configure a rule or similar that says for ISerializer's to connect the named instance based on the property name? So that I could have
MySomeClass(ISerializer jsonSerializer, ....)
And StructureMap correctly resolve this scenario? Or am I approaching this wrong and perhaps I should just register the concrete type that implements ISerializer and then just specifically use
MySomeClass(JsonSerializer jsonSerializer, ....)
for something along these lines with the concrete class?
I have a problem that is described here: http://stackoverflow.com/questions/2146198/tfs-cannot-set-up-new-build
I use Visual Studio 2008. Unfortunately, the solution provided there, didn't help.
I tried to remove and add again my TFS server - no help. Also, it's not a problem with security policies or lack of proper right, because I can initiate a new build, with the same user through Visual Studio 2005, also installed on my computer.
In addition my colleagues have no problems at all.
If someone else have experienced similar problem - I will appreciate any help !
We use Visual Source Safe 6.0 at work and VB6 is supposed to integrate smoothly with Source Safe. Both applications are installed on my PC, but VB6 is not showing the options to integrate with Source Safe (e.g. checking out a file, seeing if a file is shared, etc.).
What do I need to do to get VB6 to integrate with Source Safe 6.0?
I keep searching, but cannot find a clear and simple explanation on how to include one XCode project, along with all of it's sub-classes into another project. I routinely see stuff like that in sample projects that I download off the web, but do not know how to do this myself.
Within XCode, along with .h and .m files, and folders, there's a whole new project, starting with a blue xcode project icon, that is expandable to contain everything within the project.
Please, can someone explain to me step by step what do I need to do to add one XCode project into another one? I've seen a ton of one liners like "header search paths", but that does not tell me much.
UPDATE: After re-reading the documentation, I realized that the project to include must be dragged ONTO the BLUE project icon of the parent project. Regular sources can be dragged anywhere, but a project must be dragged onto a project.
Thank you!
I am looking for tips for someone who has done a migration before.
Also, any kind of benchmark about the migration will be very appreciated! (ex. how much time takes the migration tool to migrate a 1 gb data?)
Thanks in advance!
I need to develop a product catalog (about 4000 products) application, which would be given to clients on CD or DVD. The catalog exists in webpage format using PHP and MySQL.
IMPORTANT: the application is given to clients who maight have old PC, old System. For minimal requirements I would put Windows XP and Internet Explorer 6 (if needed).
I need the following features:
1 search option (after productID AND after keyword)
2 print option (by selecting multiple products)
3 shopping cart (making a list which will be sent to an email address if there is any Internet Connection on the computer)
When I was asked to do it I had 2 days to realise a very basic version, so I took the whole website and exported it in HTML pages, and developed an application in C# which contains an embeded browser. So the whole website is now static and put on a CD. Everything fine so far. Now here are the problems:
1. the search option was realized by parsing the html files and reading the productID or looking for keywords inside of them. Put on a CD it was extremely slow (searching in 600MB of html files). FOR THIS I WOULD NEED A SOLUTION WITH A STATIC DATABASE (USING ACCESS OR SOMETHING) TO HAVE INDEXED ROWS, SO THE SEARCH COULD BE A VERY FAST ONE.
2. the printing option was a simply call of the embeded Internet Explorer print functions. Here are two problems:
a) user needs IE7 for printing the website scaled (FIT TO PAGE), otherwise the edges of the page are cut down.
b) users of this app does not have even the basic PC usage skills, so they can't set the printing settings, so there will appear in header and footer the page numbers and titles. QUESTION: can I set these settings from CSS for printing?
3. couldn't make a a shopping cart as I don't use a database, so I have static websites and content is inside the HTML.
QUESTION: WHICH ARE THE BEST SOLUTIONS FOR THE PROBLEMS DESCRIBED ABOVE?
PLEASE ANSWER EVEN IF YOUR ANSWER IS FOR ONE QUESTION ONLY. THANKS
I've setup a git repository one a remote server. Now I'm trying to checkout from it with:
git fetch ssh://[email protected]/~username/workfolder/
but I get an error:
fatal: Not a git repository
What am I doing wrong? Could it be the server does not support Git+SSH?
Please note this is not a question about online/hosted SVN services.
I am working on a home based, solo developer, project that now has commercial significance and it is time to think about remote source code backup. There is no need for file level check in/out, all I need is once a day or once a week directory level snapshot to remote storage. Automatic encryption would be a bonus to protect my IP.
What I have in mind is some sort of GUI interface app that will squirt a source code snapshot off to an Amazon S3 bucket on an automatic schedule.
(My development PC runs on MS Windows.)
I'm just getting started with Mercurial, and I've come across something which I don't understand.
I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific file).
As far as I can see, the command I want is revert.
In the page I linked to, there is the following statement:
This operation however does not change
the parent revision of the working
directory (or revisions in case of an
uncommitted merge). To undo an
uncomitted merge, you can use "hg
update -C -r." which will reset the
parents to the first parent.
I don't understand the difference between the two (hg revert vs. hg update -C -r). Can anyone enlighten me as to the difference? And in my case, do I really want the revert or the update to go get rid of the changes I made to the file?
Thanks
Hi,
we want to use Unity for IOC.
All i've seen is the implementation that there is one global static service which holds a reference to the Unity container, which registers all interface/class combinations and every class asks that object: give me an implementation for Ithis or IThat.
Frequently i see a response that this pattern is not good because it leads to a dependency from ALL classes to this service.
But what i don't see often, is: what is the alternative way?
Michel
hi,
I did a stupid thing and branched my project on my local disk instead of doing it on the TFS. So now I have two projects on my disk: the old one which has TFS bindings and the new, which doesn't. I want to merge those changes back into the TFS project. How would I go about doing that? I can't do Compare because my local branch has no TFS bindings. There should be some way to compare the differences between the two projects locally and then meld the differences into the old project and check-in, but I can't find an easy way of doing that. Any other solutions?
Recently I developed a performance tester console application, with no UI, with the help of a IoC containter (Castle-Windsor-Microkernel). This library enabled me to let the user choose which test(s) to run, simply by changing the configuration file.
Have I realized what IoC containers are about? I'm not sure. Even Joel said here on SO that IoC are difficult to understand.
From my example, what do you conclude? Am I using IoC container for exactly what they were designed for? Or I am just using one of its secondary features?
I have a list of modifications when I run git status, but I cannot stage them or commit them. How can I fix this?
This occurred after pulling the kernelmode directory from a bare repository somewhere in one huge commit.
% git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: kernelmode/linux-2.6.33/Documentation/IO-mapping.txt
# ...
$ git add .
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: kernelmode/linux-2.6.33/Documentation/IO-mapping.txt
# ...
We are having havoc with our project at work, because our VCS is doing some awful merging when we move information across files.
The scenario is thus:
You have lots of files that, say, contain information about terms from a dictionary, so you have a file for each letter of the alphabet.
Users entering terms blindly follow the dictionary order, so they will put an entry like "kick the bucket" under B if that is where the dictionary happened to list it (or it might have been listed under both B, bucket and K, kick).
Later, other users move the terms to their correct files. Lots of work is being done on the dictionary terms all the time.
e.g. User A may have taken the B file and elaborated on the "kick the bucket" entry. User B took the B and K files, and moved the "kick the bucket" entry to the K file. Whichever order they end up getting committed in, the VCS will probably lose entries and not "figure out" that an entry has been moved.
(These entries are later automatically converted to an SQL database. But they are kept in a "human friendly" form for working on them, with lots of comments, examples etc. So it is not acceptable to say "make your users enter SQL directly".)
It is so bad that we have taken to almost manually merging these kinds of files now, because we can't trust our VCS. :(
So what is the solution? I would love to hear that there is a VCS that could cope with this. Or a better merge algorithm? Or otherwise, maybe someone can suggest a better workflow or file arrangement to try and avoid this problem?
Hi folks,
I'm trying to wire up a simple ASP.NET MVC2 controller class to my own LoggingService.
Code compiles fine, but I get the following runtime error :-
{"StructureMap Exception Code: 202
No Default Instance defined for PluginFamily System.Type, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"}
what the? mscorlib ????
Here's some sample code of my wiring up ..
protected void Application_Start()
{
MvcHandler.DisableMvcResponseHeader = true;
BootstrapStructureMap();
ControllerBuilder.Current.SetControllerFactory(
new StructureMapControllerFactory());
RegisterRoutes(RouteTable.Routes);
}
private static void BootstrapStructureMap()
{
ObjectFactory.Initialize(x =>
x.For<ILoggingService>().Use<Log4NetLoggingService>());
}
and finally the controller, simplified for this question ...
public class SearchController : Controller
{
private readonly ILoggingService _log { get; set; }
public SearchController(ILoggingService loggingService) :
base(loggingService)
{
// Error checking removed for brevity.
_log = loggingService;
_log.Tag = "SearchController";
}
...
}
and the structuremap factory (main method), also way simplified for this question...
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
IController result = null;
if (controllerType != null)
{
try
{
result = ObjectFactory.GetInstance(controllerType) as Controller;
}
catch (Exception exception)
{
if (exception is StructureMapException)
{
Debug.WriteLine(ObjectFactory.WhatDoIHave());
}
}
}
}
hmm. I just don't get it.
StructureMap version 2.6.1.0
ASP.NET MVC 2.
Any ideas?
I have the oddest problem (but aren't all programming problems odd?). I have a winform that contains a webbrowser object that opens a website that has flash on it. This winform is running on a touchscreen computer (I can't find the brand or model number).
Here is what I know:
flash objects embeded in a website that is accessed via the webbrowser object in my winform do not function properly
said flash objects only react to the first 'click' on them. So the website opens and if I hit a button, that button works but nothing afterward works within the flash object works. If my first 'click' misses a button, nothing works there after.
trying to 'click' an flash button gives the same response as just hovering over the button
This isn't a problem with the touch part of the touch screen as using a mouse also gives the same not working right response
this isn't a problem with the web page as I can open up explorer on the same computer and navigate the webpage just fine from there
The program also works 100% right on my personal computer so it shouldn't be the program's fault
if it's not the touch screen fault and not the program's fault, I can't blame anything right now.
the EXACT same program worked 100% on our old touch screen (which was having other problems so we had to get rid of it).
Oh, also, surfing just a 'normal' webpage in a webbrowser in the winform works just fine.
I have a file in a project that is in a bitkeeper repository. I checked in a file but I haven't committed the change to create a changeset. How can I undo the checkin?
If I had a changeset I could undo the commit with:
bk undo -r<rev>
But in this case I can't commit and undo the changeset because I have other checked-in files that I don't want to touch.