Karl Hasselström [Sun, 21 Sep 2008 12:17:41 +0000 (14:17 +0200)]
Add a --hard flag to stg reset
With this flag, reset will overwrite any local changes. Useful e.g.
when undoing a push that has polluted the index+worktree with a heap
of conflicts.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:40 +0000 (14:17 +0200)]
Log conflicts separately for all commands
This takes care of the old-infrastructure commands as well. They'll
all be converted to the new infrastructure eventually, but until then
this patch is necessary to make all commands behave consistently.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:40 +0000 (14:17 +0200)]
Log conflicts separately
This patch makes commands that produce a conflict log that final
conflicting push separately from the rest of the command's effects.
This makes it possible for the user to roll back just the final
conflicting push if she desires. (Rolling back the whole operation is
of course still possible, by resetting to the state yet another step
back in the log.)
This change only applies to the new-infrastructure commands.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:40 +0000 (14:17 +0200)]
New command: stg reset
Given a commit object from the log, resets the stack (or just the
named patches) to the state given by that log entry.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:40 +0000 (14:17 +0200)]
Write to a stack log when stack is modified
Create a log branch (called <branchname>.stgit) for each StGit branch,
and write to it whenever the stack is modified.
Commands using the new infrastructure write to the log when they
commit a transaction. Commands using the old infrastructure get a log
entry write written for them when they exit, unless they explicitly
ask for this not to happen.
The only thing you can do with this log at the moment is look at it.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Daniel White [Sun, 21 Sep 2008 12:17:39 +0000 (14:17 +0200)]
Fixes for auto-generation of man pages
stg.txt is the only man page not generated by stg-build --commands.
Provide this page explicitly instead of including all other
commands twice.
stg-cmd-list.txt is only a template for inclusion in other man
pages, so rename to stop it being built along with other stg-*
files.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:19:07 +0000 (14:19 +0200)]
Generate command lists automatically
Instead of hard-coding the list of stg subcommands everywhere,
generate them automatically. That way, they never get outdated (like
the list in stg.txt).
In order to not make StGit slower, we cache the list of commands; run
"make build" to update that cache (other make targets, such as "all"
and "test", imply "build"). If the cache doesn't exist, the code falls
back to importing all the command modules, which adds quite a bit of
overhead to each stg command (about 100 ms on my laptop).
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:39 +0000 (14:17 +0200)]
asciidoc.conf: Steal updates from git
Steal updates to asciidoc.conf from git. Also, make sure that we use
the link:[] abd stglink:[] macros correctly everywhere.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 21 Sep 2008 12:17:39 +0000 (14:17 +0200)]
Auto-generate man pages for all StGit commands
Auto-generate man pages based on the docs that are in each
stgit/commands/<cmd>.py file. That doc format is extended in order to
support both brief command help output and manpage text.
The existing interactive help is made briefer (just the usage, the
one-line explanation, and the option listing).
The text in the man pages needs some love, both content-wise and
asciidoc-markup-wise. This is left for future patches to resolve. (It
should be rather simple to improve the man pages one by one now that
the infrastructure is in place.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
David Kågedal [Sun, 21 Sep 2008 12:17:38 +0000 (14:17 +0200)]
Add support for initializing a branch for stgit from Emacs.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Fri, 19 Sep 2008 21:52:26 +0000 (22:52 +0100)]
Merge branch 'stable'
Conflicts:
t/t1501-sink.sh
Catalin Marinas [Thu, 18 Sep 2008 21:31:31 +0000 (22:31 +0100)]
Fix the sink command for various test cases
The t1501-sink.sh test was also improved.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Fri, 12 Sep 2008 21:22:47 +0000 (22:22 +0100)]
Autosign newly created patches
This patch adds the autosign configuration variable which is checked by
the "new" command to automatically sign the patch message.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Fri, 12 Sep 2008 21:22:18 +0000 (22:22 +0100)]
Do not crash if a patch log ref is missing
Since we'll get rid of the individual patch logs, StGit should ignore if
such a ref is missing when deleting the compatibility patch files.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Tue, 9 Sep 2008 22:12:19 +0000 (23:12 +0100)]
Merge branch 'stable'
Catalin Marinas [Tue, 9 Sep 2008 22:11:16 +0000 (23:11 +0100)]
Fix import to work properly in subdirectories
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Tue, 9 Sep 2008 21:34:30 +0000 (22:34 +0100)]
Fix the importing of config in series.py
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Shinya Kuribayashi [Sat, 6 Sep 2008 08:16:22 +0000 (10:16 +0200)]
stgit-completion.bash: Remove add/applied/cp/rm/unapplied
These commands are no longer available.
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Shinya Kuribayashi [Sat, 6 Sep 2008 08:16:22 +0000 (10:16 +0200)]
diffcol.sh: Use /bin/bash explicitly
Recent Ubuntu uses dash (Debian Almquist Shell; a lightweight POSIX-
compliant shell derived from ash) as /bin/sh by default. In this case
pager=diffcol.sh doesn't work like this:
> skuribay@ubuntu:~/kernel/linux.git$ stg show
> /home/skuribay/share/stgit/contrib/diffcol.sh: 22: Bad substitution
this is caused by non-bash-compliant /bin/sh.
diffcol.sh is based on Quilt, and Quilt is dependent on bash; Actually
all Quilt scripts use /bin/bash without exceptions. Then it's good for
diffcol.sh to use /bin/bash.
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sat, 6 Sep 2008 08:16:22 +0000 (10:16 +0200)]
Refactoring: move shared options to their own module
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sat, 6 Sep 2008 08:16:22 +0000 (10:16 +0200)]
Remove unneeded import
Signed-off-by: Karl Hasselström <kha@treskal.com>
Daniel White [Wed, 27 Aug 2008 06:38:11 +0000 (16:38 +1000)]
Remove dashed form of git command still in comment
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 26 Aug 2008 22:00:15 +0000 (00:00 +0200)]
Merge branch 'stable'
Conflicts:
stgit/commands/diff.py
stgit/commands/edit.py
stgit/commands/export.py
stgit/commands/files.py
stgit/commands/mail.py
stgit/gitmergeonefile.py
t/t1200-push-modified.sh
t/t1201-pull-trailing.sh
t/test-lib.sh
Karl Hasselström [Tue, 26 Aug 2008 21:43:49 +0000 (23:43 +0200)]
Don't use the dashed for of git commands
With the release of git 1.6.0, the dashed forms of the git commands
are no longer installed in $PATH by default, so trying to use them is
likely to fail. This patch replaces all remaining dashed git calls by
their dashless equivalents -- even in comments and docs, for
consistency and to aid grepping.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Daniel White [Fri, 22 Aug 2008 21:49:05 +0000 (22:49 +0100)]
debian/rules: take advantage of new build targets
As a result, both man and html documentation are included
in the resulting package.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Catalin Marinas [Thu, 21 Aug 2008 22:12:16 +0000 (23:12 +0100)]
Remove the duplicate utils.strip_leading function
This function is a duplicate of utils.strip_prefix.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Karl Hasselström [Thu, 21 Aug 2008 22:12:16 +0000 (23:12 +0100)]
Fix some remaining old-style stg id calls
Signed-off-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Thu, 21 Aug 2008 22:12:16 +0000 (23:12 +0100)]
Remove the applied/unapplied commands
This patch moves the applied/unapplied functionality to the 'series'
command via the corresponding options.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Thu, 21 Aug 2008 22:12:15 +0000 (23:12 +0100)]
Convert git_id() to the new id format
The patch rewrites git_id() to use the new id format and coverts the
commands using this function. The git_id() will be removed once all the
commands are converted to the new infrastructure where git_commit() will
be used instead.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Thu, 21 Aug 2008 22:12:15 +0000 (23:12 +0100)]
Implement a new patch identification scheme and id command
The new scheme allows '[<branch>:]<patch>' and '[<branch>:]{base}'
(the latter showing the base of a stack). You may append Git suffixes
like ^ and ^{...}.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Thu, 21 Aug 2008 09:45:05 +0000 (10:45 +0100)]
Allow e-mails to be sent with the Unix sendmail tool
If the stgit.smtpserver configuration option has an absolute file path
format, it is assumed to be an external tool. For example, to use
sendmail just set this variable to "/usr/sbin/sendmail -t -i" (see the
examples/gitconfig file).
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Samuel Tardieu [Mon, 4 Aug 2008 15:36:32 +0000 (17:36 +0200)]
Do not mess-up with commit message formatting when sending email
The short description, which will be used as the email subject,
gets its leading and trailing blanks removed.
The long description gets its trailing blanks removed as well
as any leading empty lines. Leading blanks are left untouched
to preserve the formatting.
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Samuel Tardieu [Mon, 4 Aug 2008 13:59:12 +0000 (15:59 +0200)]
Do not insert an empty line before the diffstat info
To make the format of stg output closer to the plain git one, do
not insert an empty line between the "---" separator and the
diffstat information.
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 4 Aug 2008 13:21:16 +0000 (15:21 +0200)]
Add some tests of refreshing removed files
Signed-off-by: Karl Hasselström <kha@treskal.com>
Daniel White [Fri, 25 Jul 2008 16:23:53 +0000 (02:23 +1000)]
Updated INSTALL with documentation of Makefile
Also includes information about requirements for
building and installing documentation like git's
INSTALL documentation.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 16:22:34 +0000 (02:22 +1000)]
Remove installation of documentation from setup.py
This is attempts to install documentation from a now
non-existent directory.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 18:00:43 +0000 (04:00 +1000)]
Add install-html target to makefile
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 16:35:39 +0000 (02:35 +1000)]
Add install-doc target to makefile
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 17:42:29 +0000 (03:42 +1000)]
Fix default install location for manpages
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 16:11:41 +0000 (02:11 +1000)]
Remove variables regarding section 7 man pages
Documentation/Makefile originally had stg.txt in section 7,
but this was changed in
36043cd62481bce58d032d06e5e79cae0ec84749.
Now section 7 is no longer used and the lack of files breaks
the install target.
It seems simpler to remove this section until it is actually
required.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Daniel White [Fri, 25 Jul 2008 16:37:04 +0000 (02:37 +1000)]
Fix Makefile to correctly pass prefix option
Was using PREFIX in top level Makefile whereas
Documentation/Makefile was using prefix. Git's
use prefix, so seems the most reasonable choice.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Karl Hasselström [Wed, 23 Jul 2008 21:29:10 +0000 (23:29 +0200)]
Global performance logging
Measure the time for the whole program, and how much of that was
subprocess calls.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:10 +0000 (23:29 +0200)]
Log subprocess calls during performance testing
Log each command's subprocess calls to a separate file.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:10 +0000 (23:29 +0200)]
Show full command in subprocess profiling
Showing just the executable name isn't so useful now that it's always
"git".
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:10 +0000 (23:29 +0200)]
Log subprocess activity to a file
If the user sets $STGIT_SUBPROCESS_LOG to a log mode followed by a
colon and a file name, append the log to that file instead of writing
it to stdout.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)]
Add some performance testing scripts
find_patchbomb.py: Given a git repo, finds the longest linear sequence
of commits. Useful for testing StGit on a real repository.
setup.sh: Creates two test repositories, one synthetic and one based
on the Linux kernel repo, with strategically placed tags.
create_synthetic_repo.py: Helper script for setup.sh; it produces
output that is to be fed to git fast-import.
perftest.py: Runs one of a (small) number of hard-coded performance
tests against a copy of one of the repos created by setup.sh. The
initial testcases all involve uncommitting a large number of patches
and then rebasing them.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 22:51:18 +0000 (00:51 +0200)]
Add utility function for reordering patches
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 24 Jul 2008 01:05:34 +0000 (03:05 +0200)]
stg goto: Handle hidden patches more gracefully
It wasn't broken before, exactly, but it did claim that hidden patches
didn't exist, which is not nice to the user.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 24 Jul 2008 01:05:29 +0000 (03:05 +0200)]
Test operations on hidden patches
Previously, we didn't test this at all. Now we have some tests at
least; and, not surprisingly, a few of them fail.
The expected result of the tests are based on the following idea of
how hidden patches should work: They should behave just like unapplied
patches when named explicitly; but if not named explicitly, they
should behave as if they didn't exist. So for example, a push without
arguments should never push a hidden patch, but it should be possible
to push a hidden patch if it is named explicitly.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 22:46:41 +0000 (00:46 +0200)]
Teach stgit.lib.transaction about hidden patches
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)]
Library functions for tree and blob manipulation
Wrap trees and blobs in Python objects (just like commits were already
wrapped), so that StGit code can read and write them.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)]
Reuse the same temp index in a transaction
Instead of making a new temp index every time we need one, just keep
reusing the same one. And keep track of which tree is currently stored
in it -- if we do several consecutive successful pushes, it's always
going to be the "right" tree so that we don't have to call read-tree
before each patch application.
The motivation behind this change is of course that it makes things
faster.
(The same simple test as in the previous patch -- pushing 250 patches
in a 32k-file repository, with one file-level merge necessary per push
-- went from 0.36 to 0.19 seconds per patch with this patch applied.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)]
Do simple in-index merge with diff+apply instead of read-tree
The advantage is that patch application will resolve some file content
conflicts for us, so that we'll fall back to merge-recursive less
often. This is a significant speedup, especially since merge-recursive
needs to touch the worktree, which means we have to check out the
index first.
(A simple test, pushing 250 patches in a 32k-file repository, with one
file-level merge necessary per push, went from 1.07 to 0.36 seconds
per patch with this patch applied.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)]
Discard stderr output from git apply if the caller wants
It prints error messages when it fails, and sometimes we don't need to
see them since we don't care exactly _why_ it failed. (The only
current user does want to see the errors, but future patches will
introduce callers that don't.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:29:08 +0000 (23:29 +0200)]
Fix uncommit status message
It should say
Uncommitting to
8561b089afbaed2651591e5a4574fdca451d82f2 (exclusive) ...
not
Uncommitting to Commit<sha1:
8561b089afbaed2651591e5a4574fdca451d82f2, data: None> (exclusive) ...
(though arguably, the sha1 should be abbreviated as well).
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 24 Jul 2008 22:01:50 +0000 (00:01 +0200)]
Make sure that stg uncommit doesn't touch the branch head
Even if top != head. It used to set head to top; but with this patch,
it doesn't anymore.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 24 Jul 2008 20:55:05 +0000 (22:55 +0200)]
stg uncommit should never touch the branch head
However, currently, it will set head to top, potentially losing data
(which can always be recovered via the reflog, but still). See
https://gna.org/bugs/index.php?12043. Add a test to demonstrate the
bad behavior. (Bug discovered by Erik Sandberg
<mandolaerik@gmail.com>.)
stg commit, on the other hand, should refuse to run if top != head,
since the committed patches might otherwise be lost. Add a test to
demonstrate that this is the case.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 24 Jul 2008 20:46:56 +0000 (22:46 +0200)]
Test for exit code with command_error()
The helper function was made for occasions such as this, so use it.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Wed, 23 Jul 2008 21:24:57 +0000 (23:24 +0200)]
Merge branch 'stable'
Conflicts:
setup.py
Daniel White [Thu, 24 Jul 2008 19:25:08 +0000 (21:25 +0200)]
Fixed default install location
Originally broken by addition of Debian package support.
The default installation direction is actually /usr at present despite
what 'INSTALL' says.
The 'debian/rules' makefile specifies the prefix as /usr so doesn't
seem to depend on this. I've tested the resulting debian package and
everything is still installed correctly under /usr.
Signed-off-by: Daniel White <daniel@whitehouse.id.au>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Fri, 18 Jul 2008 16:58:11 +0000 (18:58 +0200)]
Test that we can add a new file to a non-topmost patch with refresh -p
We currently can't -- this is bug 12038, found by Jon Smirl. See
https://gna.org/bugs/index.php?12038
Signed-off-by: Karl Hasselström <kha@treskal.com>
Miklos Vajna [Tue, 15 Jul 2008 17:46:19 +0000 (19:46 +0200)]
setup.py: fix error message when running with python-2.3
When setup.py tries to check the python version, the check actually
won't give a usable error message but it'll raise a SyntaxError. Fix
this by not using generator expressions.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Miklos Vajna [Wed, 16 Jul 2008 04:19:44 +0000 (06:19 +0200)]
setup.py: don't try to import stgit.run before the python version check
stgit.run would import datetime, which is not available in older python
versions. Import it just before it's needed.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 6 Jul 2008 16:10:08 +0000 (18:10 +0200)]
Test for "stg edit"
We weren't testing this comaratively complicated command at all. (And
not surprisingly, some corner cases that should have worked didn't.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 6 Jul 2008 16:09:08 +0000 (18:09 +0200)]
Test for specific exit code
When a command is supposed to fail in a test, test for the exact error
code we're expecting, not just that it's non-zero. This makes sure
e.g. that a command that's supposed to fail doesn't do so with an
unhandled exception.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 8 Jul 2008 18:33:36 +0000 (20:33 +0200)]
Test "stg status" with -M in stgit.diff-opts
It used to fail, before the recent merge of the -O/--diff-opts
removal, since the default value of that option was taken from
stgit.diff-opts and passed on to stgit.git.tree_status() which
couldn't handle it.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 8 Jul 2008 18:24:43 +0000 (20:24 +0200)]
Merge branch 'stable'
Conflicts:
stgit/commands/status.py
Karl Hasselström [Tue, 8 Jul 2008 18:18:50 +0000 (20:18 +0200)]
Don't allow extra diff options with "stg status"
The only extra diff options (given either with -O/--diff-opts) that
would affect "stg status" were -C and -M, and those made it crash
because it couldn't handle them. So remove those options.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 8 Jul 2008 18:18:50 +0000 (20:18 +0200)]
Test "stg status" with renames
Currently, it only works if -M is not passed to git diff-files, so the
second of the two tests fails.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 29 Jun 2008 22:47:50 +0000 (00:47 +0200)]
Merge branch 'stable' into stable-master-merge
Karl Hasselström [Sun, 29 Jun 2008 22:36:24 +0000 (00:36 +0200)]
Fix "stg sink" with no applied patches (bug 11887)
There were two separate things to fix: bail out if we need a current
patch and there isn't one (because there are no applied patches), and
make sure we don't try to pop patches that don't exist.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Sun, 29 Jun 2008 22:33:07 +0000 (00:33 +0200)]
Try "stg sink" without applied patches
It doesn't work, neither with an implicit nor an explicit patch to
sink. This is bug 11887 in the bug tracker.
(The implicit sink testcase actually passes, but that's just because
the test suite can't distinguish between a program bug and an orderly
abort.)
The test was adapted from the script attached to the bug report,
written by Erik Sandberg.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Clark Williams [Tue, 24 Jun 2008 04:09:21 +0000 (06:09 +0200)]
Patch to allow import from compressed files (gzip and bzip2)
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Thu, 19 Jun 2008 21:12:58 +0000 (22:12 +0100)]
Fix export error introduced by recent convertion
The parse_patches function wasn't accessible anymore.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Samuel Tardieu [Thu, 12 Jun 2008 16:36:59 +0000 (18:36 +0200)]
Find CmdException in common
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Thu, 12 Jun 2008 04:28:29 +0000 (06:28 +0200)]
Fix typo
Signed-off-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Sun, 8 Jun 2008 23:15:21 +0000 (00:15 +0100)]
Merge branch 'stable'
Conflicts:
stgit/version.py
Catalin Marinas [Sun, 8 Jun 2008 22:32:40 +0000 (23:32 +0100)]
Release 0.14.3
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Sun, 8 Jun 2008 22:20:16 +0000 (23:20 +0100)]
Add test_patches target to Makefile
This target tests individual patches in the series.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Sun, 8 Jun 2008 22:20:15 +0000 (23:20 +0100)]
Convert "init" to the new StGIT infrastructure
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Sun, 8 Jun 2008 22:20:15 +0000 (23:20 +0100)]
Add stack creation and initialisation support to lib.Stack
This patch adds the create and initialise Stack classmethods to handle
the initialisation of StGIT patch series on a Git branch.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Sun, 8 Jun 2008 22:20:15 +0000 (23:20 +0100)]
Create a git.Branch class as ancestor of stack.Stack
This class deals with Git-specific branch commands. The Stack class is a
direct child of Branch and some of its functionality was moved to the new
class.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Fri, 6 Jun 2008 20:35:14 +0000 (21:35 +0100)]
Rename Repository.head to Repository.head_ref
This is to avoid confusion with the Stack.head function which returns
a commit object rather than a file name. The patch also changes the
"new" function to use stack.head directly rather than via the
Repository.refs... object.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Fri, 6 Jun 2008 20:33:42 +0000 (21:33 +0100)]
Allow stack.patchorder.all to return hidden patches
A new property, patchorder.all_visible, was added to return only the
applied + unapplied patches. This is used in the "commit" command to
avoid automatically committing the hidden patches.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Thu, 5 Jun 2008 21:20:14 +0000 (22:20 +0100)]
Fix the parse_patches() function to work with tuples
The series command passes a tuple to parse_patches instead of a patch list
(the new infrastructure) but there is no patch_list.index() function.
The patch transforms the tuple into a list.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Tue, 3 Jun 2008 21:22:56 +0000 (22:22 +0100)]
Merge commit 'kha/safe'
Catalin Marinas [Tue, 3 Jun 2008 21:22:45 +0000 (22:22 +0100)]
Merge branch 'stable'
Karl Hasselström [Tue, 3 Jun 2008 03:03:16 +0000 (05:03 +0200)]
Some API documentation for the new infrastructure
Not all that comprehensive, but better than nothing.
Uses epydoc (http://epydoc.sourceforge.net/) markup.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 3 Jun 2008 00:44:18 +0000 (02:44 +0200)]
Wrap the text of error messages
... so that they fit nicely in an 80-column terminal. This makes it
unnecessary to embed newlines and extra spaces in a few places.
This patch only wraps the text of tagged output messages. I haven't
found a reason to wrap other messages, but I haven't looked long and
hard.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 3 Jun 2008 00:43:24 +0000 (02:43 +0200)]
Merge branch 'stable' into stable-master-merge
Karl Hasselström [Tue, 3 Jun 2008 00:27:48 +0000 (02:27 +0200)]
Handle refresh of changed files with non-ASCII names
Without -z, git diff-files was quoting them for us.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Tue, 3 Jun 2008 00:26:10 +0000 (02:26 +0200)]
Test for another filename quoting issue in tree_status()
stgit.git.tree_status() had another filename quoting issue, similar to
the one just fixed. Test for that one too.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 2 Jun 2008 23:45:08 +0000 (01:45 +0200)]
Handle changed files with non-ASCII names
Git was quoting them for us, which was not what we wanted. So call
diff-index with the -z flag, so that it doesn't.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 2 Jun 2008 23:40:45 +0000 (01:40 +0200)]
Add rebase test for when upstream has deleted a non-ASCII file
Test that stg rebase can handle upstream deleting a file with a
non-ASCII name. It currently can't.
Bug spotted by Jakub Narebski <jnareb@gmail.com>.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Catalin Marinas [Wed, 28 May 2008 21:02:02 +0000 (22:02 +0100)]
Convert "export" to the new infrastructure
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Wed, 28 May 2008 21:02:02 +0000 (22:02 +0100)]
Convert "top" to the new infrastructure
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Wed, 28 May 2008 21:02:02 +0000 (22:02 +0100)]
Fix error in status.py when calling git.resolved
It was using a generator instead of a list and it failed later in
Run.xargs().
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Wed, 28 May 2008 21:02:01 +0000 (22:02 +0100)]
Allow the Repository.get_stack() to get a default argument
If no argument or if it is None, it returns the current stack. This is
useful for many of the functions taking a --branch option.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Wed, 28 May 2008 21:02:01 +0000 (22:02 +0100)]
Rewrite the "series" command for the new infrastructure
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Wed, 28 May 2008 21:02:01 +0000 (22:02 +0100)]
Refactor the Commitdata class to CommitData
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>