
I'm trying to switch from HG to Darcs, but I'm failing miserably in getting the same productivity. I often do bad checkins with Darcs, merely because the amount of information I get from Darcs is overwhelming and I don't have time to read the details of the large set of commands. With Mercurial, here's my basic workflow: 1) hg st lists just the filenames of changed, deleted, new files (with a char prefix to show what kind of change it is). I only want to see the filenames, not the lines/content. If I want to see changes in the content, I use hg diff using a visual differ. My brain is not capable of making sense of the textual diff. 2) modify .hgignore to make sure only these files are added that are part of the project. I want this process to be automated, I don't want to check each time which files to add, since this is error prone. 3) hg addrem this adds new files and removes deleted files from local repos. forgetting to add files is a common problem, and is really tricky since no record is made of these files, so if after a couple of versions if a developer finds out a file was missing, the history is useless since you can't reconstruct the old content of that local file anymore, and often it's impossible to give the local file to the other developers since it might be changed. I actually would like to have an option that automatically adds/deletes files on each commit, as it is easier to delete a file after it is checked in, than it is to reconstruct an old version from a local file you forgot to add. 4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong. 5) hg pull -u this pulls in changes, and updates and merges the files, using a visual merger of my preference. 6) hg commit -m "merged" hg push only needed if I did a merge and want to push that merge. 7) back to 1) It would be nice to know how to do this using darcs, or if a better way exists using darcs, that would be handy too :)

Peter Verswyvelen
1) hg st
darcs cha -s
lists just the filenames of changed, deleted, new files (with a char prefix to show what kind of change it is).
2) modify .hgignore to make sure only these files are added that are part of the project. I want this process to be automated, I don't want to check each time which files to add, since this is error prone.
I'm not sure what you want, but I only add files manually with darcs add <filename>
3) hg addrem
this adds new files and removes deleted files from local repos.
I don't quite understand what you're asking here.
4) hg commit -m "message"
this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong.
darcs rec -m "message"
5) hg pull -u
this pulls in changes, and updates and merges the files, using a visual merger of my preference.
darcs pull [-a] No visual merger, instead conflicts are marked and you need to work it out. This is a bit clumsy, but since darcs is smart about merging, it doesn't happen too often. <knocks on wood>
6) hg commit -m "merged" hg push
darcs rec -m "merged" darcs send -k -- If I haven't seen further, it is by standing in the footprints of giants

* Peter Verswyvelen
On Thu, Feb 5, 2009 at 4:32 PM, Ketil Malde
wrote: Peter Verswyvelen
writes: 1) hg st
darcs cha -s
That seems to list all changes in the history.
hg st lists local changes only. Can be done using darcs?
darcs whatsnew -s -- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain

Roman Cheplyaka wrote:
* Peter Verswyvelen
[2009-02-05 16:35:34+0100] On Thu, Feb 5, 2009 at 4:32 PM, Ketil Malde
wrote: Peter Verswyvelen
writes: 1) hg st darcs cha -s
That seems to list all changes in the history.
hg st lists local changes only. Can be done using darcs?
darcs whatsnew -s
Or `darcs w -s` if you're really adverse to spelling things out ;) The changes command gives the whole history (to varying depth, verbosity,...), whereas the whatsnew command gives what things have been altered but not recorded yet. The -s flag to whatsnew says to give a summary (names of files and count of lines changed). If you leave -s off, then you'll get textual diffs of same. -- Live well, ~wren

Peter Verswyvelen schrieb:
3) hg addrem this adds new files and removes deleted files from local repos. forgetting to add files is a common problem, and is really tricky since no record is made of these files, so if after a couple of versions if a developer finds out a file was missing, the history is useless since you can't reconstruct the old content of that local file anymore, and often it's impossible to give the local file to the other developers since it might be changed. I actually would like to have an option that automatically adds/deletes files on each commit, as it is easier to delete a file after it is checked in, than it is to reconstruct an old version from a local file you forgot to add.
I'm also not glad with darcs behaviour about non-added files. You can try darcs whatsnew --look-for-adds David Roundy's philosophy is that you must add a test compilation with 'darcs setprefs' anyway and this one reveals forgotten files.
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong.
In old darcs its precisely the other way round. Since it is so slow on merging ready patches, you better merge uncrecorded changes.

Henning Thielemann wrote:
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong.
In old darcs its precisely the other way round. Since it is so slow on merging ready patches, you better merge uncrecorded changes.
IMO pulling & merging before commit is a good practise also for hg: it avoids a (very often useless) merge commit in the history. Pao

On 6 Feb 2009, at 10:12, Paolo Losi wrote:
Henning Thielemann wrote:
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong. In old darcs its precisely the other way round. Since it is so slow on merging ready patches, you better merge uncrecorded changes.
IMO pulling & merging before commit is a good practise also for hg: it avoids a (very often useless) merge commit in the history.
I don't understand this view. Isn't the point of a commit that you flag working points. In each branch, before you merge (hopefully) you have a working repository, so flag it as such, and commit. When you merge, you may or may not have a working repository, fix it until it is, and merge. I would never do a merge without the two branches I was merging having a commit just before the merge. Bob

Thomas Davie wrote:
On 6 Feb 2009, at 10:12, Paolo Losi wrote:
Henning Thielemann wrote:
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong. In old darcs its precisely the other way round. Since it is so slow on merging ready patches, you better merge uncrecorded changes.
IMO pulling & merging before commit is a good practise also for hg: it avoids a (very often useless) merge commit in the history.
I don't understand this view. Isn't the point of a commit that you flag working points. In each branch, before you merge (hopefully) you have a working repository, so flag it as such, and commit. When you merge, you may or may not have a working repository, fix it until it is, and merge.
I would never do a merge without the two branches I was merging having a commit just before the merge.
Bob
I think you're right. but: - if you synch with the central repo at every commit you usually have a sort of out of band protocol with your peers for avoiding conflicts and in case of conflicts the manual merge is easy (if you occasionally merge unrelated branches that is obviously a different story) - the problem with mercurial is that it doesn't allow to amend history (you cannot afford to "merge" the first commit with the "merge" commit) and the commit history becomes cluttered. That's the reason why I prefer (in the case of commit/sync/commit/sync... scenario) pulling and updating before committing. AFAIK darcs and git doesn't have this problem, so the approach your suggesting should be the best in any case. I'm an "old" user of mercurial but I'm starting seeing some shortcomings with respect to git (and probably darcs). I really hope there will be some sort of convergence on a de facto DVCS soon in the opensource community :-) Paolo

* Henning Thielemann
Peter Verswyvelen schrieb:
3) hg addrem this adds new files and removes deleted files from local repos. forgetting to add files is a common problem, and is really tricky since no record is made of these files, so if after a couple of versions if a developer finds out a file was missing, the history is useless since you can't reconstruct the old content of that local file anymore, and often it's impossible to give the local file to the other developers since it might be changed. I actually would like to have an option that automatically adds/deletes files on each commit, as it is easier to delete a file after it is checked in, than it is to reconstruct an old version from a local file you forgot to add.
I'm also not glad with darcs behaviour about non-added files. You can try
darcs whatsnew --look-for-adds
You can also pass --look-for-adds (-l) to darcs record; if you want this to be the default behaviour, you could add "record look-for-adds" to ~/.darcs/defaults or similar.
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong.
In old darcs its precisely the other way round. Since it is so slow on merging ready patches, you better merge uncrecorded changes.
This sounds like bad advice; merging changes with locally unrecorded changes shouldn't be any less expensive than merging them with a just-recorded patch (the algorithm is exactly the same, after all, unless there's something I've missed), and you have no way to roll things back if you don't record a patch before merging. Of course, you may want to unrecord your temporary patch after you've pulled, to keep your patch history neater. -- mithrandi, i Ainil en-Balandor, a faer Ambar

On 2009 Feb 5, at 9:44, Peter Verswyvelen wrote:
2) modify .hgignore to make sure only these files are added that are part of the project. I want this process to be automated, I don't want to check each time which files to add, since this is error prone.
.darcs/prefs/boring (regexes of files to be excluded)
4) hg commit -m "message" this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong.
This is how darcs record works.
5) hg pull -u this pulls in changes, and updates and merges the files, using a visual merger of my preference.
I don't think we have a visual merger yet, but this is darcs pull.
6) hg commit -m "merged" hg push
darcs record as above darcs push if you have direct access to another repo, or darcs send to generate an email patch file (darcs apply to apply it) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (9)
-
Brandon S. Allbery KF8NH
-
Henning Thielemann
-
Ketil Malde
-
Paolo Losi
-
Peter Verswyvelen
-
Roman Cheplyaka
-
Thomas Davie
-
Tristan Seligmann
-
wren ng thornton