Difference between revisions of "User:Robin Cornelius/hg folding patchsets"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with '== Folding patch sets with Mecurial == With the Stowstorm project we hit a conceptual conflict with the commit little and often method of working, where one commits small change...')
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Folding patch sets with Mecurial ==
== Folding patch sets with Mecurial ==


With the Stowstorm project we hit a conceptual conflict with the commit little and often method of working, where one commits small changes in an incremental way when working on a given project feature/bugfix. At the end of the project it is desirable to provide one change set that contains your feature or bug so that the Snowstorm team can pull from your repository. It is very undesirable for them to pull in 100 Small changesets, that may contain trivial or useless information (to anyone other that yourself), that form your overall feature/bugfix.
With the Stowstorm project we hit a conceptual conflict with the commit little and often method of working, where one commits small changes in an incremental way when working on a given project feature/bugfix. At the end of the project it is desirable to provide one change set that contains your feature or bug so that the Snowstorm team can pull from your repository. It is very undesirable for them to pull in 100 Small changesets, that may contain trivial or useless information (to anyone other than yourself), that form your overall feature/bugfix.


Under git this is extreamly trivial with squash, you can just squash down a bunch of commits to a single commit. Under Hg this is still possible but not quite as obvious.
Under git this is extreamly trivial with squash, you can just squash down a bunch of commits to a single commit. Under Hg this is still possible but not quite as obvious.


The way i am working is to create a branch
ensure there are no exiting patches in your repository, then work out what the start and end commit ids are for your series of commits you want to squash.


WORK IN PROGRESS
hg qimport -r commit_start_id:commit_end_id
hg qgoto qbase


C:\code\viewer-development>hg qimport -r S:tip
windows
  C:\code\viewer-development>hg qgoto qbase
  FOR /F "delims=" %i IN ('hg qunapp') DO @set PATCHSET=%i
C:\code\viewer-development>FOR /F "delims=" %i IN ('hg qunapp') DO @set PATCHSET=%i
  hg qfold %PATCHSET%
  C:\code\viewer-development>hg qfold %PATCHSET%
linux
  C:\code\viewer-development>hg gfinish qbase
  hg qfold $(hg qunapp)
then finish up
  hg gfinish qbase
 
Do not share a repository then squash the commits and push again, it will probably cause chaos.

Latest revision as of 05:10, 18 August 2010

Folding patch sets with Mecurial

With the Stowstorm project we hit a conceptual conflict with the commit little and often method of working, where one commits small changes in an incremental way when working on a given project feature/bugfix. At the end of the project it is desirable to provide one change set that contains your feature or bug so that the Snowstorm team can pull from your repository. It is very undesirable for them to pull in 100 Small changesets, that may contain trivial or useless information (to anyone other than yourself), that form your overall feature/bugfix.

Under git this is extreamly trivial with squash, you can just squash down a bunch of commits to a single commit. Under Hg this is still possible but not quite as obvious.

ensure there are no exiting patches in your repository, then work out what the start and end commit ids are for your series of commits you want to squash.

hg qimport -r commit_start_id:commit_end_id
hg qgoto qbase

windows

FOR /F "delims=" %i IN ('hg qunapp') DO @set PATCHSET=%i
hg qfold %PATCHSET%

linux

 hg qfold $(hg qunapp) 

then finish up

hg gfinish qbase

Do not share a repository then squash the commits and push again, it will probably cause chaos.