Differences between revisions 11 and 60 (spanning 49 versions)
Revision 11 as of 2006-01-19 19:04:38
Size: 2996
Comment:
Revision 60 as of 2007-03-20 23:03:29
Size: 5918
Editor: 211
Comment: None
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Available tips:
[[TableOfContents]]

=== Make a clean copy of a source tree, like CVS export ===

{{{
hg clone source export
rm -rf export/.hg
}}}

=== The same thing, but for a tagged release ===

{{{
hg clone --noupdate source export-tagged
cd export-tagged
hg update mytag
rm -rf .hg
}}}

=== See diffs when editing commit message with VIM ===

Make a private copy of the 'hgeditor' script provided with mercurial and replace the call to the editor with following command:

{{{
vim "+e $HGTMP/diff" '+set buftype=help filetype=diff' "+vsplit $HGTMP/msg" || exit $?
}}}

This will start up VIM in vertical split mode with commit message in the left pane and diff in the right pane. The {{{buftype=help}}} setting for diff window tells vim to exit when all other windows are closed, so when you write and quit the log with {{{:x}}} ({{{:wq}}} - they are equivalent), vim exits. If you have syntax highlight set up, the diff will be properly highlighted.

This setting is suitable for wide terminals. If you have a narrow terminal, you may want to replace the {{{+vsplit}}} above with {{{+split}}} or add {{{nowrap}}} to the {{{+set}}}.

=== See diffstat of pulled changes ===

Place the following script (named "pull-diffstat" here) somewhere in your $PATH:

{{{
#!/bin/sh
test -n "$NODE" || exit 0
PARENT=`hg parents $NODE | head -1 | awk -F':' '{print $3}'`
TIP=`hg tip | head -1 | awk -F':' '{print $3}'`
echo "diffstat for $PARENT to $TIP"
hg diff -r $PARENT -r tip | diffstat
}}}

Add a changegroup entry to the [hooks] section of hgrc:

{{{
[hooks]
changegroup = pull-diffstat
}}}

Now you will see a diffstat of the new changes to your repo every time you do "hg pull".

=== A script to use the OS X FileMerge application to perform merges ===

{{{
#!/bin/sh

LOCAL=$1
BASE=$2
OTHER=$3

# Attempt to do a non-interactive merge
cp $LOCAL $LOCAL.orig
if merge $LOCAL $BASE $OTHER 2> /dev/null; then
  # success!
  rm $LOCAL.orig
  exit 0
fi

cp $LOCAL.orig $LOCAL
# opendiff "succeeds" as long as FileMerge launches. No way to tell if the
# merge is any good but to ask...
opendiff "$OTHER" "$LOCAL" -ancestor "$BASE" -merge "$LOCAL"
echo "Merge of $LOCAL successful?"
select answer in yes no
do
  if test "$answer" == "yes"
  then
    rm $LOCAL.orig
    exit 0
  elif test "$answer" == "no"
  then
    exit 1
  fi
done

echo "filemerge: failed"
exit 1
}}}

=== One liner to remove unknown files with a pattern ===
To make these work, replace the {{{ls -l}}} with the command you wish to execute (ie. {{{rm}}}). You can also tweak the parameters passed to {{{hg status}}} to filter by something other than unknown files (see {{{hg help status}}}.

{{{
hg status -nu0 | grep -z pattern | xargs -0r ls -l
}}}

The above command requires a current version of GNU grep. If you don't have one, you can use the following:
{{{
hg status -nu | grep pattern | tr '\n' '\0' | xargs -0r ls -l
}}}
Hello, very nice site! Please also visit my homepages:
 [URL=http://www.greatprise.org/health-individual-insurance/index.html]health individual insurance[/URL] [URL=http://www.greatprise.org/agent-insurance/index.html]agent insurance[/URL] [URL=http://www.greatprise.org/business-insurance/index.html]business insurance[/URL] [URL=http://www.greatprise.org/auto-geico-insurance/index.html]auto geico insurance[/URL] [URL=http://www.greatprise.org/insurance-life-quote-term/index.html]insurance life quote term[/URL] [URL=http://www.greatprise.org/insurance-unemployment/index.html]insurance unemployment[/URL] [URL=http://www.greatprise.org/aaa-insurance/index.html]aaa insurance[/URL] [URL=http://www.greatprise.org/car-insurance-online/index.html]car insurance online[/URL] [URL=http://www.greatprise.org/farmer-insurance/index.html]farmer insurance[/URL] [URL=http://www.greatprise.org/auto-insurance-online/index.html]auto insurance online[/URL] [URL=http://www.greatprise.org/car-company-insurance/index.html]car company insurance[/URL] [URL=http://www.greatprise.org/insurance-quote/index.html]insurance quote[/URL] [URL=http://www.greatprise.org/health-insurance-quote/index.html]health insurance quote[/URL] [URL=http://www.greatprise.org/american-family-insurance/index.html]american family insurance[/URL] [URL=http://www.greatprise.org/company-health-insurance/index.html]company health insurance[/URL] [URL=http://www.greatprise.org/car-florida-insurance/index.html]car florida insurance[/URL] [URL=http://www.greatprise.org/insurance-marketing/index.html]insurance marketing[/URL] [URL=http://www.greatprise.org/affordable-health-insurance/index.html]affordable health insurance[/URL] [URL=http://www.greatprise.org/family-health-insurance/index.html]family health insurance[/URL] [URL=http://www.greatprise.org/car-cheap-insurance/index.html]car cheap insurance[/URL] [URL=http://www.greatprise.org/attorney-insurance/index.html]attorney insurance[/URL] [URL=http://www.greatprise.org/cost-health-insurance-low/index.html]cost health insurance low[/URL] [URL=http://www.greatprise.org/boat-insurance/index.html]boat insurance[/URL] [URL=http://www.greatprise.org/insurance-pet/index.html]insurance pet[/URL] [URL=http://www.greatprise.org/car-insurance-new-york/index.html]car insurance new york[/URL] [URL=http://www.greatprise.org/california-car-insurance/index.html]california car insurance[/URL] [URL=http://www.greatprise.org/car-insurance-rate/index.html]car insurance rate[/URL] [URL=http://www.greatprise.org/home-insurance-owner-quote/index.html]home insurance owner quote[/URL] [URL=http://www.greatprise.org/insurance-mercury/index.html]insurance mercury[/URL] [URL=http://www.greatprise.org/insurance-life-settlement/index.html]insurance life settlement[/URL] [URL=http://www.greatprise.org/car-cost-insurance-low/index.html]car cost insurance low[/URL] [URL=http://www.greatprise.org/health-insurance-short-term/index.html]health insurance short term[/URL] [URL=http://www.greatprise.org/accident-insurance-travel/index.html]accident insurance travel[/URL] [URL=http://www.greatprise.org/health-insurance/index.html]health insurance[/URL] [URL=http://www.greatprise.org/adjuster-insurance/index.html]adjuster insurance[/URL] [URL=http://www.greatprise.org/auto-cost-insurance-low/index.html]auto cost insurance low[/URL] [URL=http://www.greatprise.org/home-insurance-quote/index.html]home insurance quote[/URL] [URL=http://www.greatprise.org/automotive-de-insurance-wilmington/index.html]automotive de insurance wilmington[/URL] [URL=http://www.greatprise.org/health-insurance-plan/index.html]health insurance plan[/URL] [URL=http://www.greatprise.org/business-health-insurance-small/index.html]business health insurance small[/URL] [URL=http://www.greatprise.org/insurance-life/index.html]insurance life[/URL] [URL=http://www.greatprise.org/insurance-online-travel/index.html]insurance online travel[/URL] [URL=http://www.greatprise.org/allstate-insurance/index.html]allstate insurance[/URL] [URL=http://www.greatprise.org/car-insurance-online-quote/index.html]car insurance online quote[/URL]
 <a href="http://www.greatprise.org/insurance-life-term/index.html">insurance life term</a> <a href="http://www.greatprise.org/free-insurance-quote/index.html">free insurance quote</a> <a href="http://www.greatprise.org/auto-california-insurance/index.html">auto california insurance</a> <a href="http://www.greatprise.org/aaa-insurance/index.html">aaa insurance</a> <a href="http://www.greatprise.org/hartford-insurance/index.html">hartford insurance</a> <a href="http://www.greatprise.org/family-health-insurance/index.html">family health insurance</a> <a href="http://www.greatprise.org/insurance-lead/index.html">insurance lead</a> <a href="http://www.greatprise.org/insurance-life-quote/index.html">insurance life quote</a> <a href="http://www.greatprise.org/boston-insurance/index.html "> boston insurance</a> <a href="http://www.greatprise.org/auto-cost-insurance-low/index.html">auto cost insurance low</a> <a href="http://www.greatprise.org/broker-insurance/index.html">broker insurance</a> <a href="http://www.greatprise.org/accident-insurance-travel/index.html">accident insurance travel</a>
 http://www.greatprise.org/health-insurance-international-travel/index.html http://www.greatprise.org/insurance/index.html http://www.greatprise.org/claim-insurance/index.html http://www.greatprise.org/california-health-insurance/index.html http://www.greatprise.org/ca-health-insurance/index.html http://www.greatprise.org/insurance-nationwide/index.html http://www.greatprise.org/health-insurance-short-term/index.html http://www.greatprise.org/business-insurance/index.html http://www.greatprise.org/health-insurance/index.html http://www.greatprise.org/insurance-travel/index.html
Thanks!
----
CategoryNewFeatures

Hello, very nice site! Please also visit my homepages:

Thanks!


CategoryNewFeatures

TipsAndTricks (last edited 2016-12-05 11:14:36 by ArneBab)