2010-08-13 16:54:33 +04:00
|
|
|
$ cat <<EOF >> $HGRCPATH
|
|
|
|
> [extensions]
|
|
|
|
> keyword =
|
|
|
|
> mq =
|
|
|
|
> notify =
|
|
|
|
> record =
|
|
|
|
> transplant =
|
|
|
|
> [ui]
|
|
|
|
> interactive = true
|
|
|
|
> EOF
|
|
|
|
|
2012-06-21 01:41:21 +04:00
|
|
|
hide outer repo
|
|
|
|
$ hg init
|
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
Run kwdemo before [keyword] files are set up
|
|
|
|
as it would succeed without uisetup otherwise
|
|
|
|
|
2010-08-15 22:26:12 +04:00
|
|
|
$ hg --quiet kwdemo
|
2010-08-13 16:54:33 +04:00
|
|
|
[extensions]
|
|
|
|
keyword =
|
|
|
|
[keyword]
|
|
|
|
demo.txt =
|
2011-01-23 05:15:39 +03:00
|
|
|
[keywordset]
|
|
|
|
svn = False
|
2010-08-13 16:54:33 +04:00
|
|
|
[keywordmaps]
|
|
|
|
Author = {author|user}
|
|
|
|
Date = {date|utcdate}
|
|
|
|
Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
|
|
|
|
Id = {file|basename},v {node|short} {date|utcdate} {author|user}
|
|
|
|
RCSFile = {file|basename},v
|
|
|
|
RCSfile = {file|basename},v
|
|
|
|
Revision = {node|short}
|
|
|
|
Source = {root}/{file},v
|
2010-09-23 01:05:58 +04:00
|
|
|
$Author: test $
|
2010-09-23 01:06:02 +04:00
|
|
|
$Date: ????/??/?? ??:??:?? $ (glob)
|
|
|
|
$Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
|
|
|
|
$Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
|
2010-09-23 01:05:58 +04:00
|
|
|
$RCSFile: demo.txt,v $
|
|
|
|
$RCSfile: demo.txt,v $
|
2010-09-23 01:06:02 +04:00
|
|
|
$Revision: ???????????? $ (glob)
|
|
|
|
$Source: */demo.txt,v $ (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
$ hg --quiet kwdemo "Branch = {branches}"
|
|
|
|
[extensions]
|
|
|
|
keyword =
|
|
|
|
[keyword]
|
|
|
|
demo.txt =
|
2011-01-23 05:15:39 +03:00
|
|
|
[keywordset]
|
|
|
|
svn = False
|
2010-08-13 16:54:33 +04:00
|
|
|
[keywordmaps]
|
|
|
|
Branch = {branches}
|
|
|
|
$Branch: demobranch $
|
|
|
|
|
|
|
|
$ cat <<EOF >> $HGRCPATH
|
|
|
|
> [keyword]
|
|
|
|
> ** =
|
|
|
|
> b = ignore
|
2010-10-08 21:39:46 +04:00
|
|
|
> i = ignore
|
2010-08-13 16:54:33 +04:00
|
|
|
> [hooks]
|
2010-10-08 21:39:46 +04:00
|
|
|
> EOF
|
|
|
|
$ cp $HGRCPATH $HGRCPATH.nohooks
|
|
|
|
> cat <<EOF >> $HGRCPATH
|
2010-08-13 16:54:33 +04:00
|
|
|
> commit=
|
|
|
|
> commit.test=cp a hooktest
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ hg init Test-bndl
|
|
|
|
$ cd Test-bndl
|
|
|
|
|
|
|
|
kwshrink should exit silently in empty/invalid repo
|
|
|
|
|
|
|
|
$ hg kwshrink
|
|
|
|
|
|
|
|
Symlinks cannot be created on Windows.
|
|
|
|
A bundle to test this was made with:
|
|
|
|
hg init t
|
|
|
|
cd t
|
|
|
|
echo a > a
|
|
|
|
ln -s a sym
|
|
|
|
hg add sym
|
|
|
|
hg ci -m addsym -u mercurial
|
|
|
|
hg bundle --base null ../test-keyword.hg
|
|
|
|
|
2011-04-30 19:38:06 +04:00
|
|
|
$ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
|
2010-09-23 01:06:02 +04:00
|
|
|
pulling from *test-keyword.hg (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ echo 'expand $Id$' > a
|
|
|
|
$ echo 'do not process $Id:' >> a
|
|
|
|
$ echo 'xxx $' >> a
|
|
|
|
$ echo 'ignore $Id$' > b
|
|
|
|
|
|
|
|
Output files as they were created
|
|
|
|
|
|
|
|
$ cat a b
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
|
|
|
|
|
|
|
no kwfiles
|
|
|
|
|
|
|
|
$ hg kwfiles
|
|
|
|
|
|
|
|
untracked candidates
|
|
|
|
|
|
|
|
$ hg -v kwfiles --unknown
|
|
|
|
k a
|
|
|
|
|
|
|
|
Add files and check status
|
|
|
|
|
|
|
|
$ hg addremove
|
|
|
|
adding a
|
|
|
|
adding b
|
|
|
|
$ hg status
|
|
|
|
A a
|
|
|
|
A b
|
|
|
|
|
|
|
|
|
|
|
|
Default keyword expansion including commit hook
|
|
|
|
Interrupted commit should not change state or run commit hook
|
|
|
|
|
|
|
|
$ hg --debug commit
|
|
|
|
abort: empty commit message
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg status
|
|
|
|
A a
|
|
|
|
A b
|
|
|
|
|
|
|
|
Commit with several checks
|
|
|
|
|
|
|
|
$ hg --debug commit -mabsym -u 'User Name <user@example.com>'
|
|
|
|
a
|
|
|
|
b
|
|
|
|
overwriting a expanding keywords
|
|
|
|
running hook commit.test: cp a hooktest
|
|
|
|
committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
|
|
|
|
$ hg status
|
|
|
|
? hooktest
|
|
|
|
$ hg debugrebuildstate
|
|
|
|
$ hg --quiet identify
|
|
|
|
ef63ca68695b
|
|
|
|
|
|
|
|
cat files in working directory with keywords expanded
|
|
|
|
|
|
|
|
$ cat a b
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
|
|
|
|
|
|
|
hg cat files and symlink, no expansion
|
|
|
|
|
|
|
|
$ hg cat sym a b && echo
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
2010-10-09 07:36:10 +04:00
|
|
|
a
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
$ diff a hooktest
|
|
|
|
|
2010-10-08 21:39:46 +04:00
|
|
|
$ cp $HGRCPATH.nohooks $HGRCPATH
|
2010-08-13 16:54:33 +04:00
|
|
|
$ rm hooktest
|
|
|
|
|
2012-01-15 16:37:33 +04:00
|
|
|
hg status of kw-ignored binary file starting with '\1\n'
|
|
|
|
|
2012-02-08 20:56:00 +04:00
|
|
|
>>> open("i", "wb").write("\1\nfoo")
|
2012-01-15 16:37:33 +04:00
|
|
|
$ hg -q commit -Am metasep i
|
|
|
|
$ hg status
|
2012-02-08 20:56:00 +04:00
|
|
|
>>> open("i", "wb").write("\1\nbar")
|
2012-01-15 16:37:33 +04:00
|
|
|
$ hg status
|
|
|
|
M i
|
|
|
|
$ hg -q commit -m "modify metasep" i
|
|
|
|
$ hg status --rev 2:3
|
|
|
|
M i
|
|
|
|
$ touch empty
|
|
|
|
$ hg -q commit -A -m "another file"
|
|
|
|
$ hg status -A --rev 3:4 i
|
|
|
|
C i
|
|
|
|
|
|
|
|
$ hg -q strip -n 2
|
|
|
|
|
|
|
|
Test hook execution
|
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
bundle
|
|
|
|
|
|
|
|
$ hg bundle --base null ../kw.hg
|
|
|
|
2 changesets found
|
|
|
|
$ cd ..
|
|
|
|
$ hg init Test
|
|
|
|
$ cd Test
|
|
|
|
|
|
|
|
Notify on pull to check whether keywords stay as is in email
|
|
|
|
ie. if patch.diff wrapper acts as it should
|
|
|
|
|
|
|
|
$ cat <<EOF >> $HGRCPATH
|
|
|
|
> [hooks]
|
|
|
|
> incoming.notify = python:hgext.notify.hook
|
|
|
|
> [notify]
|
|
|
|
> sources = pull
|
|
|
|
> diffstat = False
|
2010-10-09 16:13:51 +04:00
|
|
|
> maxsubject = 15
|
2010-08-13 16:54:33 +04:00
|
|
|
> [reposubs]
|
|
|
|
> * = Test
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Pull from bundle and trigger notify
|
|
|
|
|
|
|
|
$ hg pull -u ../kw.hg
|
|
|
|
pulling from ../kw.hg
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 3 changes to 3 files
|
|
|
|
Content-Type: text/plain; charset="us-ascii"
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Transfer-Encoding: 7bit
|
2010-09-23 01:06:02 +04:00
|
|
|
Date: * (glob)
|
2010-10-09 16:13:51 +04:00
|
|
|
Subject: changeset in...
|
2010-08-13 16:54:33 +04:00
|
|
|
From: mercurial
|
|
|
|
X-Hg-Notification: changeset a2392c293916
|
2010-09-23 01:06:02 +04:00
|
|
|
Message-Id: <hg.a2392c293916*> (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
To: Test
|
|
|
|
|
2011-11-07 06:25:10 +04:00
|
|
|
changeset a2392c293916 in $TESTTMP/Test (glob)
|
2011-03-10 15:43:47 +03:00
|
|
|
details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
|
2010-08-13 16:54:33 +04:00
|
|
|
description:
|
|
|
|
addsym
|
|
|
|
|
|
|
|
diffs (6 lines):
|
|
|
|
|
|
|
|
diff -r 000000000000 -r a2392c293916 sym
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/sym Sat Feb 09 20:25:47 2008 +0100
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+a
|
|
|
|
\ No newline at end of file
|
|
|
|
Content-Type: text/plain; charset="us-ascii"
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Transfer-Encoding: 7bit
|
2010-09-23 01:06:02 +04:00
|
|
|
Date:* (glob)
|
2010-10-09 16:13:51 +04:00
|
|
|
Subject: changeset in...
|
2010-08-13 16:54:33 +04:00
|
|
|
From: User Name <user@example.com>
|
|
|
|
X-Hg-Notification: changeset ef63ca68695b
|
2010-09-23 01:06:02 +04:00
|
|
|
Message-Id: <hg.ef63ca68695b*> (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
To: Test
|
|
|
|
|
2011-11-07 06:25:10 +04:00
|
|
|
changeset ef63ca68695b in $TESTTMP/Test (glob)
|
2010-10-09 07:36:10 +04:00
|
|
|
details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
|
2010-08-13 16:54:33 +04:00
|
|
|
description:
|
|
|
|
absym
|
|
|
|
|
|
|
|
diffs (12 lines):
|
|
|
|
|
|
|
|
diff -r a2392c293916 -r ef63ca68695b a
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/a Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -0,0 +1,3 @@
|
|
|
|
+expand $Id$
|
|
|
|
+do not process $Id:
|
|
|
|
+xxx $
|
|
|
|
diff -r a2392c293916 -r ef63ca68695b b
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/b Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+ignore $Id$
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
2010-10-08 21:39:46 +04:00
|
|
|
$ cp $HGRCPATH.nohooks $HGRCPATH
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Touch files and check with status
|
|
|
|
|
|
|
|
$ touch a b
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
Update and expand
|
|
|
|
|
|
|
|
$ rm sym a b
|
|
|
|
$ hg update -C
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cat a b
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
|
|
|
|
2011-09-08 22:30:25 +04:00
|
|
|
Check whether expansion is filewise and file mode is preserved
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
$ echo '$Id$' > c
|
|
|
|
$ echo 'tests for different changenodes' >> c
|
2012-07-03 20:02:07 +04:00
|
|
|
#if unix-permissions
|
2011-09-08 22:30:25 +04:00
|
|
|
$ chmod 600 c
|
|
|
|
$ ls -l c | cut -b 1-10
|
|
|
|
-rw-------
|
2012-07-03 20:02:07 +04:00
|
|
|
#endif
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
commit file c
|
|
|
|
|
|
|
|
$ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
|
|
|
|
adding c
|
2012-07-03 20:02:07 +04:00
|
|
|
#if unix-permissions
|
2011-09-08 22:30:25 +04:00
|
|
|
$ ls -l c | cut -b 1-10
|
|
|
|
-rw-------
|
2012-07-03 20:02:07 +04:00
|
|
|
#endif
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
force expansion
|
|
|
|
|
|
|
|
$ hg -v kwexpand
|
|
|
|
overwriting a expanding keywords
|
|
|
|
overwriting c expanding keywords
|
|
|
|
|
|
|
|
compare changenodes in a and c
|
|
|
|
|
|
|
|
$ cat a c
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
|
|
|
|
tests for different changenodes
|
|
|
|
|
2010-10-10 03:30:09 +04:00
|
|
|
record
|
|
|
|
|
|
|
|
$ echo '$Id$' > r
|
|
|
|
$ hg add r
|
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
record chunk
|
|
|
|
|
2012-07-03 20:02:07 +04:00
|
|
|
>>> lines = open('a', 'rb').readlines()
|
2011-11-23 05:20:32 +04:00
|
|
|
>>> lines.insert(1, 'foo\n')
|
|
|
|
>>> lines.append('bar\n')
|
2012-07-03 20:02:07 +04:00
|
|
|
>>> open('a', 'wb').writelines(lines)
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg record -d '10 1' -m rectest a<<EOF
|
2010-08-13 16:54:33 +04:00
|
|
|
> y
|
|
|
|
> y
|
|
|
|
> n
|
|
|
|
> EOF
|
|
|
|
diff --git a/a b/a
|
|
|
|
2 hunks, 2 lines changed
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
examine changes to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
expand $Id$
|
|
|
|
+foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
record change 1/2 to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -2,2 +3,3 @@
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
+bar
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
record change 2/2 to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
$ hg identify
|
2012-07-04 04:04:58 +04:00
|
|
|
5f5eb23505c3+ tip
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg status
|
|
|
|
M a
|
2010-10-10 03:30:09 +04:00
|
|
|
A r
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Cat modified file a
|
|
|
|
|
|
|
|
$ cat a
|
2012-07-04 04:04:58 +04:00
|
|
|
expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
|
2010-08-13 16:54:33 +04:00
|
|
|
foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
bar
|
|
|
|
|
|
|
|
Diff remaining chunk
|
|
|
|
|
2010-10-10 03:30:09 +04:00
|
|
|
$ hg diff a
|
2012-07-04 04:04:58 +04:00
|
|
|
diff -r 5f5eb23505c3 a
|
|
|
|
--- a/a Thu Jan 01 00:00:09 1970 -0000
|
2010-09-23 01:06:02 +04:00
|
|
|
+++ b/a * (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -2,3 +2,4 @@
|
|
|
|
foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
+bar
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 2 (undo commit)
|
|
|
|
working directory now based on revision 2
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Record all chunks in file a
|
|
|
|
|
|
|
|
$ echo foo > msg
|
|
|
|
|
|
|
|
- do not use "hg record -m" here!
|
|
|
|
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg record -l msg -d '11 1' a<<EOF
|
2010-08-13 16:54:33 +04:00
|
|
|
> y
|
|
|
|
> y
|
|
|
|
> y
|
|
|
|
> EOF
|
|
|
|
diff --git a/a b/a
|
|
|
|
2 hunks, 2 lines changed
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
examine changes to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
expand $Id$
|
|
|
|
+foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
record change 1/2 to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -2,2 +3,3 @@
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
+bar
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
record change 2/2 to 'a'? [Ynesfdaq?]
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
File a should be clean
|
|
|
|
|
|
|
|
$ hg status -A a
|
|
|
|
C a
|
2010-09-26 21:18:41 +04:00
|
|
|
|
|
|
|
rollback and revert expansion
|
|
|
|
|
|
|
|
$ cat a
|
2012-07-04 04:04:58 +04:00
|
|
|
expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
|
2010-09-26 21:18:41 +04:00
|
|
|
foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
bar
|
|
|
|
$ hg --verbose rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 2 (undo commit)
|
|
|
|
working directory now based on revision 2
|
2010-09-26 21:18:41 +04:00
|
|
|
overwriting a expanding keywords
|
|
|
|
$ hg status a
|
|
|
|
M a
|
|
|
|
$ cat a
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
foo
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
bar
|
|
|
|
$ echo '$Id$' > y
|
|
|
|
$ echo '$Id$' > z
|
|
|
|
$ hg add y
|
|
|
|
$ hg commit -Am "rollback only" z
|
|
|
|
$ cat z
|
|
|
|
$Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
|
|
|
|
$ hg --verbose rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 2 (undo commit)
|
|
|
|
working directory now based on revision 2
|
2010-09-26 21:18:41 +04:00
|
|
|
overwriting z shrinking keywords
|
|
|
|
|
|
|
|
Only z should be overwritten
|
|
|
|
|
|
|
|
$ hg status a y z
|
|
|
|
M a
|
|
|
|
A y
|
|
|
|
A z
|
|
|
|
$ cat z
|
|
|
|
$Id$
|
|
|
|
$ hg forget y z
|
|
|
|
$ rm y z
|
|
|
|
|
2010-10-10 03:30:09 +04:00
|
|
|
record added file alone
|
2010-08-13 16:54:33 +04:00
|
|
|
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg -v record -l msg -d '12 2' r<<EOF
|
2010-10-08 21:39:46 +04:00
|
|
|
> y
|
|
|
|
> EOF
|
|
|
|
diff --git a/r b/r
|
|
|
|
new file mode 100644
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
examine changes to 'r'? [Ynesfdaq?]
|
2010-10-08 21:39:46 +04:00
|
|
|
r
|
2012-07-04 04:04:58 +04:00
|
|
|
committed changeset 3:82a2f715724d
|
2010-10-08 21:39:46 +04:00
|
|
|
overwriting r expanding keywords
|
2011-09-10 16:23:41 +04:00
|
|
|
- status call required for dirstate.normallookup() check
|
|
|
|
$ hg status r
|
2010-10-08 21:39:46 +04:00
|
|
|
$ hg --verbose rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 2 (undo commit)
|
|
|
|
working directory now based on revision 2
|
2010-10-08 21:39:46 +04:00
|
|
|
overwriting r shrinking keywords
|
|
|
|
$ hg forget r
|
|
|
|
$ rm msg r
|
2010-10-10 03:30:09 +04:00
|
|
|
$ hg update -C
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2010-10-08 21:39:46 +04:00
|
|
|
|
2010-10-24 18:11:41 +04:00
|
|
|
record added keyword ignored file
|
|
|
|
|
|
|
|
$ echo '$Id$' > i
|
|
|
|
$ hg add i
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg --verbose record -d '13 1' -m recignored<<EOF
|
2010-10-24 18:11:41 +04:00
|
|
|
> y
|
|
|
|
> EOF
|
|
|
|
diff --git a/i b/i
|
|
|
|
new file mode 100644
|
record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines. The
current record extension does not allow these to be committed independently.
An example use case for this is in software development for deeply embedded
real-time systems. In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used. When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong. printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository. If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines. This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest. It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.
There were two alternatives I considered for the user interface. One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration. The latter option would require a significant
refactor of the record module and is less flexible. While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.
I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable. This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there. It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.
Possible future improvements include:
* Tidying up the 'prompt' code to base everything on the choices variable.
This would allow entries to be removed from the prompt as currently 'e' is
offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
this would require quite a large refactor without much benefit, so I decided
to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
This would require quite a bit of refactoring given the current 'hg record'
implementation, so it's debatable whether it's worth it.
Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch. This opens the
user's configured editor with the patch. A comment is added to the bottom of
the patch explaining what to do (based on Git's one).
A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-31 01:08:46 +04:00
|
|
|
examine changes to 'i'? [Ynesfdaq?]
|
2010-10-24 18:11:41 +04:00
|
|
|
i
|
2012-07-04 04:04:58 +04:00
|
|
|
committed changeset 3:9f40ceb5a072
|
2010-10-24 18:11:41 +04:00
|
|
|
$ cat i
|
|
|
|
$Id$
|
|
|
|
$ hg -q rollback
|
|
|
|
$ hg forget i
|
|
|
|
$ rm i
|
|
|
|
|
2012-05-26 22:46:12 +04:00
|
|
|
amend
|
|
|
|
|
|
|
|
$ echo amend >> a
|
|
|
|
$ echo amend >> b
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg -q commit -d '14 1' -m 'prepare amend'
|
2012-05-26 22:46:12 +04:00
|
|
|
|
2012-07-04 04:04:58 +04:00
|
|
|
$ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
|
2012-05-26 22:46:12 +04:00
|
|
|
overwriting a expanding keywords
|
|
|
|
$ hg -q id
|
2012-07-04 04:04:58 +04:00
|
|
|
577e60613a88
|
2012-05-26 22:46:12 +04:00
|
|
|
$ head -1 a
|
2012-07-04 04:04:58 +04:00
|
|
|
expand $Id: a,v 577e60613a88 1970/01/01 00:00:15 test $
|
2012-05-26 22:46:12 +04:00
|
|
|
|
|
|
|
$ hg -q strip -n tip
|
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
Test patch queue repo
|
|
|
|
|
|
|
|
$ hg init --mq
|
|
|
|
$ hg qimport -r tip -n mqtest.diff
|
|
|
|
$ hg commit --mq -m mqtest
|
|
|
|
|
|
|
|
Keywords should not be expanded in patch
|
|
|
|
|
|
|
|
$ cat .hg/patches/mqtest.diff
|
|
|
|
# HG changeset patch
|
|
|
|
# User User Name <user@example.com>
|
|
|
|
# Date 1 0
|
|
|
|
# Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
|
|
|
|
# Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
|
|
|
|
cndiff
|
|
|
|
|
|
|
|
diff -r ef63ca68695b -r 40a904bbbe4c c
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/c Thu Jan 01 00:00:01 1970 +0000
|
|
|
|
@@ -0,0 +1,2 @@
|
|
|
|
+$Id$
|
|
|
|
+tests for different changenodes
|
|
|
|
|
|
|
|
$ hg qpop
|
|
|
|
popping mqtest.diff
|
|
|
|
patch queue now empty
|
|
|
|
|
|
|
|
qgoto, implying qpush, should expand
|
|
|
|
|
|
|
|
$ hg qgoto mqtest.diff
|
|
|
|
applying mqtest.diff
|
|
|
|
now at: mqtest.diff
|
|
|
|
$ cat c
|
|
|
|
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
|
|
|
|
tests for different changenodes
|
|
|
|
$ hg cat c
|
|
|
|
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
|
|
|
|
tests for different changenodes
|
|
|
|
|
|
|
|
Keywords should not be expanded in filelog
|
|
|
|
|
|
|
|
$ hg --config 'extensions.keyword=!' cat c
|
|
|
|
$Id$
|
|
|
|
tests for different changenodes
|
|
|
|
|
|
|
|
qpop and move on
|
|
|
|
|
|
|
|
$ hg qpop
|
|
|
|
popping mqtest.diff
|
|
|
|
patch queue now empty
|
|
|
|
|
|
|
|
Copy and show added kwfiles
|
|
|
|
|
|
|
|
$ hg cp a c
|
|
|
|
$ hg kwfiles
|
|
|
|
a
|
|
|
|
c
|
|
|
|
|
|
|
|
Commit and show expansion in original and copy
|
|
|
|
|
|
|
|
$ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
|
|
|
|
c
|
|
|
|
c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
|
2012-05-10 20:21:15 +04:00
|
|
|
removing unknown node 40a904bbbe4c from 1-phase boundary
|
2010-08-13 16:54:33 +04:00
|
|
|
overwriting c expanding keywords
|
|
|
|
committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
|
|
|
|
$ cat a c
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
|
|
|
|
Touch copied c and check its status
|
|
|
|
|
|
|
|
$ touch c
|
|
|
|
$ hg status
|
|
|
|
|
2010-10-08 21:39:46 +04:00
|
|
|
Copy kwfile to keyword ignored file unexpanding keywords
|
|
|
|
|
|
|
|
$ hg --verbose copy a i
|
|
|
|
copying a to i
|
|
|
|
overwriting i shrinking keywords
|
|
|
|
$ head -n 1 i
|
|
|
|
expand $Id$
|
|
|
|
$ hg forget i
|
|
|
|
$ rm i
|
|
|
|
|
|
|
|
Copy ignored file to ignored file: no overwriting
|
|
|
|
|
|
|
|
$ hg --verbose copy b i
|
|
|
|
copying b to i
|
|
|
|
$ hg forget i
|
|
|
|
$ rm i
|
|
|
|
|
2010-12-01 12:51:49 +03:00
|
|
|
cp symlink file; hg cp -A symlink file (part1)
|
|
|
|
- copied symlink points to kwfile: overwrite
|
2010-10-08 21:39:46 +04:00
|
|
|
|
2012-07-03 20:02:07 +04:00
|
|
|
#if symlink
|
2010-10-08 21:39:46 +04:00
|
|
|
$ cp sym i
|
|
|
|
$ ls -l i
|
2010-10-09 16:13:49 +04:00
|
|
|
-rw-r--r--* (glob)
|
2010-10-08 21:39:46 +04:00
|
|
|
$ head -1 i
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
$ hg copy --after --verbose sym i
|
|
|
|
copying sym to i
|
|
|
|
overwriting i shrinking keywords
|
|
|
|
$ head -1 i
|
|
|
|
expand $Id$
|
|
|
|
$ hg forget i
|
|
|
|
$ rm i
|
2012-07-03 20:02:07 +04:00
|
|
|
#endif
|
2010-10-08 21:39:46 +04:00
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
Test different options of hg kwfiles
|
|
|
|
|
|
|
|
$ hg kwfiles
|
|
|
|
a
|
|
|
|
c
|
|
|
|
$ hg -v kwfiles --ignore
|
|
|
|
I b
|
|
|
|
I sym
|
|
|
|
$ hg kwfiles --all
|
|
|
|
K a
|
|
|
|
K c
|
|
|
|
I b
|
|
|
|
I sym
|
|
|
|
|
|
|
|
Diff specific revision
|
|
|
|
|
2010-08-30 08:15:30 +04:00
|
|
|
$ hg diff --rev 1
|
2010-08-13 16:54:33 +04:00
|
|
|
diff -r ef63ca68695b c
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
2010-09-23 01:06:02 +04:00
|
|
|
+++ b/c * (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
@@ -0,0 +1,3 @@
|
|
|
|
+expand $Id$
|
|
|
|
+do not process $Id:
|
|
|
|
+xxx $
|
|
|
|
|
|
|
|
Status after rollback:
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 1 (undo commit)
|
|
|
|
working directory now based on revision 1
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg status
|
|
|
|
A c
|
|
|
|
$ hg update --clean
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
2012-06-10 20:50:42 +04:00
|
|
|
#if symlink
|
|
|
|
|
2010-12-01 12:51:49 +03:00
|
|
|
cp symlink file; hg cp -A symlink file (part2)
|
|
|
|
- copied symlink points to kw ignored file: do not overwrite
|
|
|
|
|
|
|
|
$ cat a > i
|
|
|
|
$ ln -s i symignored
|
|
|
|
$ hg commit -Am 'fake expansion in ignored and symlink' i symignored
|
|
|
|
$ cp symignored x
|
|
|
|
$ hg copy --after --verbose symignored x
|
|
|
|
copying symignored to x
|
|
|
|
$ head -n 1 x
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
$ hg forget x
|
|
|
|
$ rm x
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 1 (undo commit)
|
|
|
|
working directory now based on revision 1
|
2010-12-01 12:51:49 +03:00
|
|
|
$ hg update --clean
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ rm i symignored
|
|
|
|
|
2012-06-10 20:50:42 +04:00
|
|
|
#endif
|
|
|
|
|
2010-08-13 16:54:33 +04:00
|
|
|
Custom keywordmaps as argument to kwdemo
|
|
|
|
|
|
|
|
$ hg --quiet kwdemo "Xinfo = {author}: {desc}"
|
|
|
|
[extensions]
|
|
|
|
keyword =
|
|
|
|
[keyword]
|
|
|
|
** =
|
|
|
|
b = ignore
|
|
|
|
demo.txt =
|
2010-10-08 21:39:46 +04:00
|
|
|
i = ignore
|
2011-01-23 05:15:39 +03:00
|
|
|
[keywordset]
|
|
|
|
svn = False
|
2010-08-13 16:54:33 +04:00
|
|
|
[keywordmaps]
|
|
|
|
Xinfo = {author}: {desc}
|
|
|
|
$Xinfo: test: hg keyword configuration and expansion example $
|
|
|
|
|
|
|
|
Configure custom keywordmaps
|
|
|
|
|
|
|
|
$ cat <<EOF >>$HGRCPATH
|
|
|
|
> [keywordmaps]
|
|
|
|
> Id = {file} {node|short} {date|rfc822date} {author|user}
|
|
|
|
> Xinfo = {author}: {desc}
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Cat and hg cat files before custom expansion
|
|
|
|
|
|
|
|
$ cat a b
|
|
|
|
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
|
|
|
$ hg cat sym a b && echo
|
|
|
|
expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
ignore $Id$
|
2010-10-09 07:36:10 +04:00
|
|
|
a
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Write custom keyword and prepare multiline commit message
|
|
|
|
|
|
|
|
$ echo '$Xinfo$' >> a
|
|
|
|
$ cat <<EOF >> log
|
|
|
|
> firstline
|
|
|
|
> secondline
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Interrupted commit should not change state
|
|
|
|
|
|
|
|
$ hg commit
|
|
|
|
abort: empty commit message
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? c
|
|
|
|
? log
|
|
|
|
|
|
|
|
Commit with multiline message and custom expansion
|
|
|
|
|
|
|
|
$ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
|
|
|
|
a
|
2012-05-10 20:21:15 +04:00
|
|
|
removing unknown node 40a904bbbe4c from 1-phase boundary
|
2010-08-13 16:54:33 +04:00
|
|
|
overwriting a expanding keywords
|
|
|
|
committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
|
|
|
|
$ rm log
|
|
|
|
|
|
|
|
Stat, verify and show custom expansion (firstline)
|
|
|
|
|
|
|
|
$ hg status
|
|
|
|
? c
|
|
|
|
$ hg verify
|
|
|
|
checking changesets
|
|
|
|
checking manifests
|
|
|
|
crosschecking files in changesets and manifests
|
|
|
|
checking files
|
|
|
|
3 files, 3 changesets, 4 total revisions
|
|
|
|
$ cat a b
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
|
|
|
ignore $Id$
|
|
|
|
$ hg cat sym a b && echo
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
|
|
|
ignore $Id$
|
2010-10-09 07:36:10 +04:00
|
|
|
a
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
annotate
|
|
|
|
|
|
|
|
$ hg annotate a
|
|
|
|
1: expand $Id$
|
|
|
|
1: do not process $Id:
|
|
|
|
1: xxx $
|
|
|
|
2: $Xinfo$
|
|
|
|
|
|
|
|
remove with status checks
|
|
|
|
|
|
|
|
$ hg debugrebuildstate
|
|
|
|
$ hg remove a
|
|
|
|
$ hg --debug commit -m rma
|
|
|
|
committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
|
|
|
|
$ hg status
|
|
|
|
? c
|
|
|
|
|
|
|
|
Rollback, revert, and check expansion
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 2 (undo commit)
|
|
|
|
working directory now based on revision 2
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg status
|
|
|
|
R a
|
|
|
|
? c
|
|
|
|
$ hg revert --no-backup --rev tip a
|
|
|
|
$ cat a
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
|
|
|
|
|
|
|
Clone to test global and local configurations
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Expansion in destinaton with global configuration
|
|
|
|
|
|
|
|
$ hg --quiet clone Test globalconf
|
|
|
|
$ cat globalconf/a
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
|
|
|
|
|
|
|
No expansion in destination with local configuration in origin only
|
|
|
|
|
|
|
|
$ hg --quiet --config 'keyword.**=ignore' clone Test localconf
|
|
|
|
$ cat localconf/a
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo$
|
|
|
|
|
|
|
|
Clone to test incoming
|
|
|
|
|
|
|
|
$ hg clone -r1 Test Test-a
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 3 changes to 3 files
|
|
|
|
updating to branch default
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd Test-a
|
|
|
|
$ cat <<EOF >> .hg/hgrc
|
|
|
|
> [paths]
|
|
|
|
> default = ../Test
|
|
|
|
> EOF
|
|
|
|
$ hg incoming
|
2011-11-07 06:25:10 +04:00
|
|
|
comparing with $TESTTMP/Test (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
searching for changes
|
|
|
|
changeset: 2:bb948857c743
|
|
|
|
tag: tip
|
|
|
|
user: User Name <user@example.com>
|
|
|
|
date: Thu Jan 01 00:00:02 1970 +0000
|
|
|
|
summary: firstline
|
|
|
|
|
|
|
|
Imported patch should not be rejected
|
|
|
|
|
2011-11-23 05:20:32 +04:00
|
|
|
>>> import re
|
|
|
|
>>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
|
|
|
|
>>> open('a', 'wb').write(text)
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
|
|
|
|
a
|
|
|
|
overwriting a expanding keywords
|
|
|
|
committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
|
|
|
|
$ hg export -o ../rejecttest.diff tip
|
|
|
|
$ cd ../Test
|
|
|
|
$ hg import ../rejecttest.diff
|
|
|
|
applying ../rejecttest.diff
|
|
|
|
$ cat a b
|
|
|
|
expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
|
|
|
|
do not process $Id: rejecttest
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: rejects? $
|
|
|
|
ignore $Id$
|
|
|
|
|
|
|
|
$ hg rollback
|
import: wrap a transaction around the whole command
Now 'rollback' after 'import' is less surprising: it rolls back all of
the imported changesets, not just the last one. As an extra added
benefit, you don't need 'rollback -f' after 'import --bypass', which
was an undesired side effect of fixing issue2998 (f9f52d71c33b)..
Note that this is a different take on issue963, which complained that
rollback after importing multiple patches returned the working dir
parent to the starting point, not to the second-last patch applied.
Since we now rollback the entire import, returning the working dir to
the starting point is entirely logical. So this change also undoes
b12d79024900, the fix to issue963, and updates its tests accordingly.
Bottom line: rollback after import was weird before issue963,
understandable since the fix for issue963, and even better now.
2011-10-02 22:34:28 +04:00
|
|
|
repository tip rolled back to revision 2 (undo import)
|
2011-02-10 11:03:06 +03:00
|
|
|
working directory now based on revision 2
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg update --clean
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
kwexpand/kwshrink on selected files
|
|
|
|
|
|
|
|
$ mkdir x
|
|
|
|
$ hg copy a x/a
|
2010-10-24 18:11:41 +04:00
|
|
|
$ hg --verbose kwshrink a
|
|
|
|
overwriting a shrinking keywords
|
2011-09-10 16:23:41 +04:00
|
|
|
- sleep required for dirstate.normal() check
|
|
|
|
$ sleep 1
|
2010-10-24 18:11:41 +04:00
|
|
|
$ hg status a
|
2010-08-13 16:54:33 +04:00
|
|
|
$ hg --verbose kwexpand a
|
|
|
|
overwriting a expanding keywords
|
2010-10-24 18:11:41 +04:00
|
|
|
$ hg status a
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
kwexpand x/a should abort
|
|
|
|
|
|
|
|
$ hg --verbose kwexpand x/a
|
|
|
|
abort: outstanding uncommitted changes
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-13 16:54:33 +04:00
|
|
|
$ cd x
|
|
|
|
$ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
|
|
|
|
x/a
|
|
|
|
x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
|
|
|
|
overwriting x/a expanding keywords
|
|
|
|
committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
|
|
|
|
$ cat a
|
|
|
|
expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: xa $
|
|
|
|
|
|
|
|
kwshrink a inside directory x
|
|
|
|
|
|
|
|
$ hg --verbose kwshrink a
|
|
|
|
overwriting x/a shrinking keywords
|
|
|
|
$ cat a
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo$
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
kwexpand nonexistent
|
|
|
|
|
|
|
|
$ hg kwexpand nonexistent
|
2010-09-23 01:06:02 +04:00
|
|
|
nonexistent:* (glob)
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
|
2012-07-03 20:02:07 +04:00
|
|
|
#if serve
|
2010-08-13 16:54:33 +04:00
|
|
|
hg serve
|
|
|
|
- expand with hgweb file
|
|
|
|
- no expansion with hgweb annotate/changeset/filediff
|
|
|
|
- check errors
|
|
|
|
|
|
|
|
$ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
|
|
|
|
$ cat hg.pid >> $DAEMON_PIDS
|
2012-06-21 05:05:02 +04:00
|
|
|
$ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
|
2010-08-13 16:54:33 +04:00
|
|
|
200 Script output follows
|
|
|
|
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
2012-06-21 05:05:02 +04:00
|
|
|
$ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
|
2010-08-13 16:54:33 +04:00
|
|
|
200 Script output follows
|
|
|
|
|
|
|
|
|
|
|
|
user@1: expand $Id$
|
|
|
|
user@1: do not process $Id:
|
|
|
|
user@1: xxx $
|
|
|
|
user@2: $Xinfo$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-21 05:05:02 +04:00
|
|
|
$ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
|
2010-08-13 16:54:33 +04:00
|
|
|
200 Script output follows
|
|
|
|
|
|
|
|
|
|
|
|
# HG changeset patch
|
|
|
|
# User User Name <user@example.com>
|
|
|
|
# Date 3 0
|
|
|
|
# Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
|
|
|
|
# Parent bb948857c743469b22bbf51f7ec8112279ca5d83
|
|
|
|
xa
|
|
|
|
|
|
|
|
diff -r bb948857c743 -r b4560182a3f9 x/a
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/x/a Thu Jan 01 00:00:03 1970 +0000
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
+expand $Id$
|
|
|
|
+do not process $Id:
|
|
|
|
+xxx $
|
|
|
|
+$Xinfo$
|
|
|
|
|
2012-06-21 05:05:02 +04:00
|
|
|
$ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
|
2010-08-13 16:54:33 +04:00
|
|
|
200 Script output follows
|
|
|
|
|
|
|
|
|
|
|
|
diff -r ef63ca68695b -r bb948857c743 a
|
|
|
|
--- a/a Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/a Thu Jan 01 00:00:02 1970 +0000
|
|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
+$Xinfo$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ cat errors.log
|
2012-07-03 20:02:07 +04:00
|
|
|
#endif
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Prepare merge and resolve tests
|
|
|
|
|
|
|
|
$ echo '$Id$' > m
|
|
|
|
$ hg add m
|
|
|
|
$ hg commit -m 4kw
|
|
|
|
$ echo foo >> m
|
|
|
|
$ hg commit -m 5foo
|
|
|
|
|
|
|
|
simplemerge
|
|
|
|
|
|
|
|
$ hg update 4
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo foo >> m
|
|
|
|
$ hg commit -m 6foo
|
|
|
|
created new head
|
|
|
|
$ hg merge
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ hg commit -m simplemerge
|
|
|
|
$ cat m
|
|
|
|
$Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
|
|
|
|
foo
|
|
|
|
|
|
|
|
conflict: keyword should stay outside conflict zone
|
|
|
|
|
|
|
|
$ hg update 4
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo bar >> m
|
|
|
|
$ hg commit -m 8bar
|
|
|
|
created new head
|
|
|
|
$ hg merge
|
|
|
|
merging m
|
|
|
|
warning: conflicts during merge.
|
2011-11-17 04:04:19 +04:00
|
|
|
merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
|
2010-08-13 16:54:33 +04:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
|
2010-09-13 03:05:53 +04:00
|
|
|
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-08-13 16:54:33 +04:00
|
|
|
$ cat m
|
|
|
|
$Id$
|
|
|
|
<<<<<<< local
|
|
|
|
bar
|
|
|
|
=======
|
|
|
|
foo
|
|
|
|
>>>>>>> other
|
|
|
|
|
|
|
|
resolve to local
|
|
|
|
|
|
|
|
$ HGMERGE=internal:local hg resolve -a
|
|
|
|
$ hg commit -m localresolve
|
|
|
|
$ cat m
|
2011-05-02 21:20:29 +04:00
|
|
|
$Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
|
2010-08-13 16:54:33 +04:00
|
|
|
bar
|
|
|
|
|
|
|
|
Test restricted mode with transplant -b
|
|
|
|
|
|
|
|
$ hg update 6
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg branch foo
|
|
|
|
marked working directory as branch foo
|
2011-12-09 00:32:44 +04:00
|
|
|
(branches are permanent and global, did you want a bookmark?)
|
2010-08-13 16:54:33 +04:00
|
|
|
$ mv a a.bak
|
|
|
|
$ echo foobranch > a
|
|
|
|
$ cat a.bak >> a
|
|
|
|
$ rm a.bak
|
|
|
|
$ hg commit -m 9foobranch
|
|
|
|
$ hg update default
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg -y transplant -b foo tip
|
|
|
|
applying 4aa30d025d50
|
2011-05-02 21:20:29 +04:00
|
|
|
4aa30d025d50 transplanted to e00abbf63521
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Expansion in changeset but not in file
|
|
|
|
|
|
|
|
$ hg tip -p
|
2011-05-02 21:20:29 +04:00
|
|
|
changeset: 11:e00abbf63521
|
2010-08-13 16:54:33 +04:00
|
|
|
tag: tip
|
2011-05-02 21:20:29 +04:00
|
|
|
parent: 9:800511b3a22d
|
2010-08-13 16:54:33 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: 9foobranch
|
|
|
|
|
2011-05-02 21:20:29 +04:00
|
|
|
diff -r 800511b3a22d -r e00abbf63521 a
|
2010-08-13 16:54:33 +04:00
|
|
|
--- a/a Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/a Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
+foobranch
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
|
|
|
|
$ head -n 2 a
|
|
|
|
foobranch
|
2011-05-02 21:20:29 +04:00
|
|
|
expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
|
2010-08-13 16:54:33 +04:00
|
|
|
|
2010-09-26 21:18:41 +04:00
|
|
|
Turn off expansion
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
$ hg -q rollback
|
|
|
|
$ hg -q update -C
|
|
|
|
|
|
|
|
kwshrink with unknown file u
|
|
|
|
|
|
|
|
$ cp a u
|
|
|
|
$ hg --verbose kwshrink
|
|
|
|
overwriting a shrinking keywords
|
|
|
|
overwriting m shrinking keywords
|
|
|
|
overwriting x/a shrinking keywords
|
|
|
|
|
|
|
|
Keywords shrunk in working directory, but not yet disabled
|
|
|
|
- cat shows unexpanded keywords
|
|
|
|
- hg cat shows expanded keywords
|
|
|
|
|
|
|
|
$ cat a b
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo$
|
|
|
|
ignore $Id$
|
|
|
|
$ hg cat sym a b && echo
|
|
|
|
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo: User Name <user@example.com>: firstline $
|
|
|
|
ignore $Id$
|
2010-10-09 07:36:10 +04:00
|
|
|
a
|
2010-08-13 16:54:33 +04:00
|
|
|
|
|
|
|
Now disable keyword expansion
|
|
|
|
|
|
|
|
$ rm "$HGRCPATH"
|
|
|
|
$ cat a b
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo$
|
|
|
|
ignore $Id$
|
|
|
|
$ hg cat sym a b && echo
|
|
|
|
expand $Id$
|
|
|
|
do not process $Id:
|
|
|
|
xxx $
|
|
|
|
$Xinfo$
|
|
|
|
ignore $Id$
|
2010-10-09 07:36:10 +04:00
|
|
|
a
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|