Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
uXs
May 3, 2005

Mark it zero!
We use SourceSafe (but we're looking to switch.)

I have this project where I had the urgent (and temporary) need to have a version control system that has excellent support for branching and merging, so since a week or 2 I've been using Git locally (I'm the only developer on this project for the moment.)

So far it has worked really well and it's too bad I won't be able to recommend it for use for the entire group because of the substandard Windows support. :(

I'm going to check out Mercurial and Subversion, and choose between those two.

Adbot
ADBOT LOVES YOU

uXs
May 3, 2005

Mark it zero!
I'm using git on Windows, and I want to configure an external tool (diffmerge) for diffs. I'm supposed to set an option "diff.external" as the command to call the tool. So I did, but when I call "git diff", the external tool isn't called, it just shows the diff right in the git bash shell. It also doesn't complain when I put gibberish in the diff.external option and then call diff.

The manual says that the environment variable GIT_EXTERNAL_DIFF would override diff.external, but I don't have it set.

I configured diffmerge as an external tool as well, and that does work. I got all the info on how to configure it from http://www.davesquared.net/2009/02/setting-up-diff-and-merge-tools-for-git.html

Any ideas?

uXs
May 3, 2005

Mark it zero!
Question on Mercurial:

At some point in the past, I switched from SourceSafe to Git for a project. I didn't convert the repository, I simply turned off the SourceSafe binding, threw away the .ssc files, and created a new Git repository.

I now can't stand working with SS any more, so I'm going to push for a switch to Mercurial. (Windows support in Git isn't good enough.) I've tested Mercurial for some other projects and it looks fine. (I only used Git for this one project because I really need something that could branch and merge easily.)

Now I have a problem though: I want to convert the SourceSafe projects to Mercurial projects. For most projects that are still in SourceSafe, it'll be easy: just run the conversion script and we're done.

For the project I mentioned above though, it's not that easy. I basically have a repository A, converted from SourceSafe, with all the history up to 3 months ago. Then I have another repository B, converted from Git, with history from 3 months ago until today. I there some way to stitch both of them together ? I basically want to say: "revision 1 from repository B now has revision 927 from repo A as a parent", without having to resolve any conflicts. Any ideas how to do this ?

uXs
May 3, 2005

Mark it zero!

uXs posted:

...

I basically want to say: "revision 1 from repository B now has revision 927 from repo A as a parent", without having to resolve any conflicts. Any ideas how to do this ?

I found how to do this with some help from the mercurial mailing list:

a) Make a new repository ('merged'), and pull both repositories. (The second pull will require an -f switch because they're unrelated.)
b) Find the full 40-character long revision keys for the revisions that you want to stitch together. These can be found in the shamap file. Put them in a text file on one line (separate with a space), with the revision that is going to become the child first, and the parent revision second.
c) run the command 'hg convert merged really_merged --splicemap splice.txt'. (You'll need the convert extension enabled for this.) This will make a repo 'really_merged' that is really merged.

uXs
May 3, 2005

Mark it zero!
As far as I know, pretty much all distributed systems are better at branching and (especially) merging than non-distributed systems. Advising a switch to git or mercurial or whatever doesn't seem too crazy to me. Especially since it's just himself and not an entire company.

I basically tried out git for the exact same reason. (I did come from SourceSafe, I guess svn could be a bit better.) And I AM switching the entire company over to Mercurial now :v:

uXs
May 3, 2005

Mark it zero!

Factor Mystic posted:

Is there any way to rename the author of a commit in Mercurial? I accidental skipped a letter in my name when configuring TortoiseHg and now a few recent commits in the repo have the wrong author name. Unfortunately I have also pushed those commits to the bitbucket repo, and it's bugging the hell out of me.

Things I have already tried:
- hgcollapse will only allow you to collapse your own commits, not ones from another author (which technically is what's happening). Plus I'd rather keep the commits separate if possible
- Stripping the commits, and re-pushing my local repo to bitbucket. This re-pushed the wrong author names as expected, even though I had already corrected my misspelling in the config. I'm hoping it's possible to manually edit the local repo somehow, then a strip and re-push would work?

My first instinct would be to try the convert extension. There's bound to be some way to map usernames to other usernames there while you do the conversion.

uXs
May 3, 2005

Mark it zero!

supster posted:

I'm trying to get some sort of version control working with my remote web server. I set up an SVN repository (on a hosted service) and figured that if I map my remote web server as a drive in Windows (via FTP) then I would be able to use the TortoiseSVN context menus normally in the mapped folder. However they don't appear at all - what are my other options?

I'm basically trying to commit remote files that I have access to via FTP.

What are you trying to do here exactly? Why do you need a version control system on your webserver?

uXs
May 3, 2005

Mark it zero!
Use a distributed system. You can do whatever the gently caress you want locally, and synchronize it afterwards.

uXs
May 3, 2005

Mark it zero!
I was assuming that you can develop locally, and then just swap changesets around with whoever else is working on it. And then release to the webserver when something is done.

If you really have to develop remotely, which sucks, can't you install a VCS remotely as well? Git and Mercurial or whatever don't require a whole lot of installation (though this can perhaps depend on what kind of system it is, maybe.)

uXs
May 3, 2005

Mark it zero!

supster posted:

edit2: and yes, obviously I need local copies of the files to make changes and then push back via FTP - but yes, this process is automated by my editor.

So, um, you're making local copies... which you edit... and then copy back? Isn't this like another way of saying that you are developing locally? Then why can't you just version control your local copies?

uXs
May 3, 2005

Mark it zero!

Karanth posted:

Nothing's wrong with hg, git just has some really killer features that make it a lot nicer to use once you get the hang of it. The index/staging area http://plasmasturm.org/log/gitidxpraise/ and the pile of ways that git makes screwing around with your repo history easy, for example.

If you primarily use that staging area to make partial commits, well, hg can do partial commits too. I do it all the time.

uXs
May 3, 2005

Mark it zero!

Sizzlechest posted:

It's a specious argument since a centralized server doesn't require the same kind of merge tracking as a distributed one. There's a single repository everyone is working from. People aren't creating personal branches to work in and then merging them with public ones. They're working from a shared branch or trunk. Merge conflicts get resolved on incremental commits. Merging between branches and the trunk is tracked sufficiently. I suppose you could do private branching in Subversion, but there's no logical reason you'd want to, nor was it designed with that in mind.

If two people are working on the same project at the same time, they're already branching the project, whether you choose to call it that or not. Hg/Git choose to make what you're doing clearly visible, SVN tries to hide ite

Sizzlechest posted:

There's no reason why a private company like the one mentioned needs to implement a distributed system. They don't need have one of them play "merge manager" and reject on a problem like Linus does. They can handle conflicts as they happen, which improves communication.

As said before, there's also no reason why a private company shouldn't implement a distributed sytem. gently caress, I'm using Hg to version my personal projects at home, and nobody else is going to ever see that code.

Sizzlechest posted:

If convenience is the main concern, don't even use a VCS. Nothing is faster or easier to use than a hard drive's file system.

If you really believe this, this by itself proves that your opinion is worthless.

uXs fucked around with this message at 21:19 on Mar 11, 2010

uXs
May 3, 2005

Mark it zero!

Magicmat posted:

Total newbie question here, but why rebase instead of merge in git? I'm trying to think of a good reason (and I assume there must be since everybody uses it so much) but I am failing.

I'm reading Pro Git right now and the chapter on rebasing explains nicely what rebasing is, but not why it is desirable other than to "clean up" a commit history -- but why are 3 inline commits 'cleaner' than a merge of a branch with 3 commits in it? (other than saving a single 'merge' commit, I guess.)

It's because of babbies who can't handle a non-linear history, even though a non-linear history is what actually happened.

I never used rebase and I can't see why I ever would use it. If you can't see a good reason, don't use it.

(And squashing history is even worse: you're not only changing history, you're actually destroying it. Destroying history in a version control system, think about it. Eww.)

uXs
May 3, 2005

Mark it zero!

epswing posted:

I've convinced the team to switch to Mercurial! Yay! We have a bunch of repositories on a server (windows box), one for each project.

So now it's time for linuxy programmer to become windowsy IT guy, because "I advocated for the stupid thing, so I better make it work."

I've been using TortoiseHG to launch the graphical webserver for each, giving each one its own port (8000, 8001, etc), clicking the "Start" button on each. Screw that, so I now have a batch file that looks like this
pre:
cd D:\hg\Project1
hg serve -d -p 8000

cd D:\hg\Project2
hg serve -d -p 8001

...

cd D:\hg\ProjectN
hg serve -d -p (8000 + N)
and it does work, but what I'd really like to have is an auto-launched windows service for each project, that someone can stop/start from that Services window somewhere in the control panel.

There's this thing http://mercurial.selenic.com/wiki/HgService but it looks like it can only run one server at a time ("WorkingDirectory the repository folder, if it's not specified it takes the install directory").

Am I going about this the wrong way?

The best way is probably to set up an SSL server somehow, and use that. I have no idea how to do that though, it sounds like it's a pain on Windows.

Personally I just use a shared folder (on a server) and push/pull over network shares. Then again, most projects we do is just one person working on something, so we don't get any conflicts. From hanging around in the mercurial IRC channel, I get the impression that this 'solution' is rather frowned upon.

On top of that I'm also using hgwebdir as a tool to view the contents of all the repositories. It's pretty great. Look here for how to set it up on IIS: http://vampirebasic.blogspot.com/2009/06/running-mercurial-on-windows.html Even if you stick with using shares or SSL or whatever, I'd still suggest setting up hgwebdir because it's so incredibly useful for browsing repositories (and the entire history) without having to clone them.

I think it's possible to set up hgwebdir to allow push access as well, but I haven't looked into that yet. Maybe I should.

As for hg serve: it's really not meant as a real, permanent solution, but only in situations where you quickly, temporarily, need a server.

About the VS thing: Zhentar already answered you about the VS solution files, but I want to stress that you really need to pay attention to what you include or ignore. I have introduced a ton of people to Mercurial, taking great pains to tell them that they really need to know what they add to a repo, but basically everybody will ignore that and happily include a ton of compiled files that shouldn't be in source control.

Especially for the first few projects you need to go over the file list, file by file, to see if they should really be in there. If you're not sure, look it up. After you've done it a few times, your ignore files should be pretty standard so it will be quicker then. (Also check to see if you don't ignore too much. If you think you're done, clone the repo to some other machine and check if it still works.)

Edit: quick point about build directories: in most cases you can just ignore everything in there, but there's one exception: websites. In the bin folder you can sometimes find .refresh files. These are pointers to where some referenced DLL files are, and you do need those. Everything else can be ignored.

uXs fucked around with this message at 22:14 on Oct 5, 2010

uXs
May 3, 2005

Mark it zero!

Munkeymon posted:

Is there any way to pause and restart a clone in git like one might a normal HTTP transfer?

Our shittastic router likes to choke transfers over ~1 MB that aren't encrypted. My normal way around this is to 'pause' the transfer and restart it until finished, but I don't see a way to do that to git. Yes, I tried using git://. Never buy ZyXEL products, btw.

Can you do an incremental clone? Get a few changesets at a time, not everything at once.

Or you could do the clone from somewhere sane, burn it on dvd, and just copy it. Once you have it, you can link it again to original repo. Changesets from that point should be small enough to work.

uXs
May 3, 2005

Mark it zero!
Mercurial does track renames, but you need to explicitly tell it about them.

uXs
May 3, 2005

Mark it zero!

Wheany posted:

So is there a way to tell Mercurial "I don't care about these files" without it deleting them on the next commit?

We have a bunch of poo poo on a development web server that sits under the same root as "my" project, but in a different sub directory.

code:
webroot/
  +-.hg 
  +-project.php
  +-project2.php
  +-subdir_of_project/
  +-shit_not_part_of_project/
      +-logo.gif
      +-index.html
I added shit_not_part_of_project into .hgignore, but can other developers now delete shit_not_part_of_project from their repositories without it being deleted from the webroot in the next push? (In reality the subdirectory contains thousands of files)

The current situation is kind of poo poo, but I can live with it if it's not possible.

(I tried "hg forget", but that didn't work quite as I thought :downsgun:. Thank god for version control :v:)

It depends if the files are already in source control or not. hgignore only works for files that Mercurial doesn't know about yet.

If they're not under source control yet, you can just add it to .hgignore.
If they are under source control, I think hg forget is what you need. (Plus adding them to .hgignore.) But in this case you'll have to coordinate what you're doing with the other devs because otherwise you'll have trouble.

uXs
May 3, 2005

Mark it zero!
What? No it doesn't.

Edit: after rereading your first post: it will delete them when you push though (or to be more correct, when you update after a push), which I guess is your problem.

If I'm following correctly, you should do:

hg forget the files locally, and add them to .hgignore
then commit

make a backup of the files on the server
push your changes to the server, and update it
at this point the forgotten files will be deleted on the server, but you have a backup, so put it back

Now both locally and on the server the files will be ignored, and your next commits and pushes and updates will all ignore them. Just make sure to never update your server to the changeset where you removed/ignored the files, or any changeset before it.

(Also, test all this before you actually do this on a live server. It also wouldn't hurt to experiment some more with deletes and ignores and everything so you really have a good handle on all of this.)

(And personally, I'm not a fan of using push&update to deploy stuff to a server. You should have some kind of real deployment script/program that handles all this.)

uXs fucked around with this message at 23:27 on Nov 17, 2010

uXs
May 3, 2005

Mark it zero!

epswing posted:

My question got skipped :(

http://forums.somethingawful.com/showthread.php?threadid=3113983&pagenumber=15&perpage=40#post383276306

When going back to fix a bug in an old tagged version, and merging back into the main line of development, shouldn't I clone/update to the rev after the tag to avoid that pesky .hgtags merge conflict?

Yes.

uXs
May 3, 2005

Mark it zero!
I don't really care. I tag stuff sometimes, and it works for me.

As for conflicts, I don't really see where those are coming from. If tags from multiple branches are merged, just add all of them and you're done.

uXs
May 3, 2005

Mark it zero!

epswing posted:

pre:
4.0.0          4.1.0          4.2.0          4.3.0
--o----o----o----o----o----o----o----o----o----o--
     \                                   /
      \   4.0.1                         /
       -----o---------------------------
  • 4.0.0 under development
  • 4.0.0 released
  • 4.1.0 under development
  • 4.1.0 released
  • 4.2.0 under development
  • 4.2.0 released
  • 4.3.0 under development
  • find bug in 4.0.0
    • clone/update to tag 4.0.0
    • commit fix
    • tag as 4.0.1
    • pull (multiple heads here)
    • merge (resolve conflicts here)
    • commit
    • push
  • 4.3.0 released

I've merged a fix from an old release into the main line of development, which will be released as 4.3.0, that's all good. What about clients of mine that are in between, running 4.1.0 and 4.2.0? Don't they need the fix too, released as 4.1.1 and 4.2.1? I'm not sure how I can merge the fix into both the main line of development, AND intermediate minor builds.

We're using mercurial. Is this what mercurial's "branches" are for?

Nothing is stopping you from merging 4.0.1 with 4.1.0, and releasing that as 4.1.1.

That will result in another head. Maybe you could merge that into 4.2.0, and release that as 4.2.1. That will still leave you with one head that you can just merge into the main line.

uXs
May 3, 2005

Mark it zero!

Magicmat posted:

Won't that result in having to manually fix all the merge conflicts created by the changes from 4.0 to 4.1, and then the same for the changes between 4.1 to 4.2? Or will it just be a fast-forward merge save for the one bugfix?Honest question, because I'm new to DVCS myself.

While I'm here, here's a question I've wondered about Github: is there a conscious decision around why they don't have a tree graph (or DAG or swim-lane graph or whatever you call it)? Bitbucket has this on their commits page, as do a lot of Git log viewers (including git log --graph).

If you have conflicts in the first merge and solve them, I'd think you won't get the same conflicts again in the next one. Fast-forward merges are a git-specific thing as far as I know, with what seems like scary voodoo magic behind the scenes.

You could just try it out and see, that's one of the fun things about dvcs. Make a clone and go wild, and if it fails just throw it away again.

uXs
May 3, 2005

Mark it zero!
I tested Git at work (on Windows) and while it worked well for my purposes, I knew I couldn't switch the company over to it because the Windows support isn't a first class priority in Git. For Mercurial on the other hand, Windows support is a critical feature, so I switched us to that.

I know it's been said before, but the alternative to Git on Windows isn't Svn, it's Hg.

uXs
May 3, 2005

Mark it zero!
I don't see why you need to make it so complicated, forcing people to use unnatural constructs as rebasing and poo poo.

Just write code, branch and merge, it's easy.

uXs
May 3, 2005

Mark it zero!

Mithaldu posted:

Rebasing is incredibly useful as it makes merging easier. Instead of having to resolve ALL the conflicts all at once when merging, you can detach your branch and reattach it at a later commit, then resolve all the conflicts with that, then detach it again and reattach it an even later commit and repeat the process until your branch is based off master. Then you merge it in and have no conflicts.

Maybe you could just merge more often?

uXs
May 3, 2005

Mark it zero!

Mithaldu posted:

Yes, of course. I could constantly watch what's happening in the main branch and merge things into my branch, even if i don't know whether i'm happy with my changes as they are. Of course i'll lock the history of my branch in, because fixing issues in a feature branch with "revert blargh" commits is clearly superior to just going back and fixing bad commits. Of course i always have connectivity so there's never a time when i'm not able to stay on top of these things. Of course i'll also happily clutter up my commit history with hundreds of pointless merge commits.

Or you know, i could just use an elegant and useful tool like rebase.

But the merges would be what you're actually doing, so they're not pointless.

Anyway, whatever. I just wanted to point out that going out of your way to make your development history completely linear isn't the only way to go. In development, branching happens all the time. It's not a crime to have your history show that.

uXs
May 3, 2005

Mark it zero!

Emo Businessman posted:

I am converting a SVN repo to a hg repo and using splicemaps to indicate where merges happened in the original SVN repo, since hg convert doesn't (can't) pick up on that automatically. However, I think I might have cocked it up:

http://hg.funcrusherplus.net/doomseeker/graph/290?revcount=50

What I expected to see was a nice straight tan line with a green branch that was branched, merged from trunk to branch and then finally the branch merged back in. What it ends up looking like is that the line starts green with trunk revisions, then the green trunk branches off while a new tan line is created that is closer to the left which represents the branch. Then, the final merge happens and green trunk is merged into tan branch and then tan becomes the new trunk.

Does this mean that I cocked something up in my splice map? Or is it just display weirdness that I can't avoid? My splicemap looks like so:

It looks ok to me, but that's probably because I look at it the other way around:

I do my 'experimental' work in the 'default' branch, and maintenance work is done in a maintenance branch.

If you look at it like that, you have your actual development all happening on the left, in a straight line. You start a branch on the right, do some bugfixes in it (half your changesets even start with 'fixed' in the description), merge those fixes in your main branch, do some more fixes, and merge them back in again.

Anyway, it's just a way of looking at it, it doesn't really matter. I think they show it like that because it shows the changesets in chronological order, and as much to the left as it can. Even better (or worse), you'll find that the graph can change in appearance from developer to developer, depending on when changesets got pulled and pushed.

The only thing that matters here is that changesets have the right parents, and that looks to be the case here.

uXs
May 3, 2005

Mark it zero!

Misogynist posted:

uh

This always comes up and it's always wrong.

uXs
May 3, 2005

Mark it zero!

Smugdog Millionaire posted:

TortoiseSVN is still 5x-50x slicker than either TortoiseGit or TortoiseHG, so I guess everyone should probably be using SVN if they're developing on Windows.

Have you used TortoiseHg recently? Not attacking you or anything, just curious.

uXs
May 3, 2005

Mark it zero!
Anyone have experience with the lock extension for Mercurial? Does it actually work? Can it be integrated into TortoiseHg?

uXs
May 3, 2005

Mark it zero!

epswing posted:

I've been using mercurial for a couple years now, mostly for small projects with a small number of people working on them.

Can someone explain to me the usefulness of in-repo branches?

Our workflow is as follows. There's a central repo which I clone onto my machine. I don't work on that clone though, I treat it as my "main" repo, which is the only one which will have changes sync'd with the central repo. I then clone my main repo whenever I have to work on something (a bug, a feature, etc). So my "feature branch" is just another clone of my main repo.

code:
            central repo
                  |            server
------------------+------------------
                  |                  
                  |          internet        
                  |                  
------------------+------------------
                  |         localhost
                  |
             my main repo
             /          \
            /            \
       feature 1       bug 2
Things have been running smoothly. For any given repo, I've never needed a branch other than 'default'.

Bugfixes on code that is running in production somewhere. I tag the revision that is released. Then I go on coding new stuff. When I need to fix something in the production code, I go back to the tagged revision, fix the bug in a new branch called 'maintenance', and then merge the fix into default. From then on, more bugfixes all go into the maintenance branch. (Which gets merged into default every time.)

Calling the maintenance branch 'maintenance' doesn't do anything except make it more obvious that this is the maintenance branch.

uXs
May 3, 2005

Mark it zero!

epswing posted:

Pull from central repo into my main repo. Clone my main repo, update back to the tagged version running in production, fix the code, commit, merge the fix into tip, and push the fix back into my main repo. Which gets pulled into the central repo.

I don't need branches for this workflow. And "other work" isn't affected because I'm working on other work in other clones.

We're basically doing the same, except that I don't have to do the cloning. So mine is less work. Also less disk space.

Biggest difference though, is that afterwards, I can see which commits were done in maintenance and which were done in default.

In mercurial, both methods are pretty much the same. You can have the same functionality with anonymous branches or named branches, with or without clones. There's a small difference in workflow, but the biggest one, to me, is that naming your branches makes it more obvious what you are doing. You can name your branches in clones too, the result would be the same. It's just more work and I don't see the point.

uXs
May 3, 2005

Mark it zero!

Strict 9 posted:

I'm setting up Git for me and two other developers. We all work on our own machines and then push our code to a Github repo. The general workflow is:

1) Make changes
2) Commit and push
3) Log into production server
4) Pull changes
5) Build project (in Visual Studio)

I'm trying to see if there's a way to automate 3 and 4, and possibly 5. Is there a way to remotely trigger a Git pull for another repo? So that when we commit and push, we could run a command that has the production server automatically pull down the changes?

I never understood why people use source control to push things into production. Or why they apparently don't have a test server. Or why they actually build things on their production servers. Or why they have Visual Studio installed on a production server.

Maybe it's just me.

uXs
May 3, 2005

Mark it zero!

Mithaldu posted:

As long as you're fine with not having the latest and greatest from develop in your feature branch that's all easily doable. But honestly, i'd suggest to gently caress merging and rebase your poo poo. You do feature branches usually because you're the only one working on them, so it's fine to get creative on them. Rebasing also gives you the MASSIVE advantage of being able to rebase up one-by-one and resolve conflicts piece by tiny piece, instead of in one massive merge.

Merging is possible step by step too, you know. Admittedly, it won't look pretty :-)

uXs
May 3, 2005

Mark it zero!

VerySolidSnake posted:

ColdPie, I appreciate the response!

Tags seem to make the most sense since development is linear. I also found some git commands that would allow me to clone a previous git tag into a different directory, so if I wanted I could have easy access to testing old versions.

I believe I will also stick with using 2 branches for now as well. One as the master, the other as development. Once I merge the two, I will create a tag, then begin working on the development branch again.

Read this. It's about Mercurial, but explains why a default and a stable branch could be easier to work with than a development and a master branch.

Edit: this = http://stevelosh.com/blog/2010/05/mercurial-workflows-stable-default/

uXs fucked around with this message at 13:48 on Oct 27, 2011

uXs
May 3, 2005

Mark it zero!

Golbez posted:

So we finally have git set up but I'm really confused how to handle multiple people merging.

I have a branch, test, that I merged a feature in to earlier today. The other developer has now merged his new feature into it, and in the process - since his new feature was branched off before I merged mine in - it deleted the files that mine added.

1) How do we get around this?
2) How can I force git to not remove files without asking?

Edit: Corollary: When should we pull, and I guess when we pull (I'm guessing before a merge?) we should merge the pulled copy into the branched feature?

Did he actually merge with your things?

If he did, he did his merge incorrectly. But I don't know enough about Git to know where exactly.

uXs
May 3, 2005

Mark it zero!

Golbez posted:

We're still not sure what went wrong. Since we're converting an existing, non-version controlled codebase to use branches and all that, hiccups are slipping through. He never completed the merge, and now using a tool it seems like he's getting around it, but I'm still not sure.

A merge is a pretty simple concept. You have 2 revisions, and need to merge those into 1 revision. So you tell your system that, and it prepares for you a revision that it thinks is a combination of those two. If it can't, it should indicate to you where the problem areas are, and give you the opportunity to merge those areas manually.

When that's all done, you can check your work (this is where you should test both your changes as the changes the other guy made), and then commit it.

uXs
May 3, 2005

Mark it zero!

Horse Cock Johnson posted:

Is the Mercurial book linked in the OP still the best/most current on the subject? Has Mercurial even changed enough since 2009 for it to even matter? Or is there a more up to date book I should read?

I don't know about anything better, but it's probably a bit old. It puts a bit too much emphasis on cloning, while mercurial itself has moved in the direction of named branches.

uXs
May 3, 2005

Mark it zero!

epswing posted:

Upgraded from TortoiseHG 1.x to 2.x

When there's a merge conflict, 1.x would launch kdiff3 with three columns on top (before any changes, the local changes, the remote changes) and one pane on the bottom showing the resulting file. Some lines in the bottom pane would contain <MERGE CONFLICT> which meant you had to choose code from one (or more) of the above panes.

All good.

Now, I'm seeing this Resolve Conflicts dialog


The the files up top have unresolved merge conflicts. I select one, and click "mercurial resolve" which results in an error, as expected, because why else would the file be in the Resolve Conflicts window if mercurial could have automatically merged it. Good. (Why is that button even there?)

But when I click on "tool resolve", the file is marked as resolved and just jumps to the lower listbox without launching kdiff3 as described above.

How can "mercurial resolve" fail, and "tool resolve" succeed without launching the tool and me manually expressing how the merge should be resolved?

I think it's like this:

If there are conflicts (= changes from different branches in the same file) in some files, it launches the Resolve Conflicts dialog. At this point, it hasn't tried to resolve the conflicts.

Then when you do tool resolve, it actually tries to resolve the conflicts itself. If they're trivial, hg can resolve them and it doesn't bother showing you a merge tool. (You can still launch one yourself with the '3-way Diff' button - which is something is ALWAYS do.) But if they're not trivial, it shows you your merge tool.

Adbot
ADBOT LOVES YOU

uXs
May 3, 2005

Mark it zero!

Flobbster posted:

This has me thinking now. We've just started adopting git on some of our two-man projects (moving from CVS on Sourceforge :gonk: ), and we pretty much do the same thing. Each of us clones the repo, does some work, pushes changes back, pulls the other guys'... and it just feels wrong. We've run into some merging issues here and there but we weren't sure how much of that was our fault for not having the best workflow.

Seems ok to me. Pull. Do work, commit. Repeat that step until you feel like pushing. Then pull & merge anything that changed while you were working, and push.

Of cource, if you're one of those weirdos that insists on a linear history, then never mind.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply