chiark / gitweb /
stgit
15 years agoRemove the duplicate utils.strip_leading function
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>
15 years agoFix some remaining old-style stg id calls
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>
15 years agoRemove the applied/unapplied commands
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>
15 years agoConvert git_id() to the new id format
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>
15 years agoImplement a new patch identification scheme and id command
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>
15 years agoAllow e-mails to be sent with the Unix sendmail tool
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>
15 years agoDo not mess-up with commit message formatting when sending email
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>
15 years agoDo not insert an empty line before the diffstat info
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>
15 years agoAdd some tests of refreshing removed files
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>
15 years agoUpdated INSTALL with documentation of Makefile
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>
15 years agoRemove installation of documentation from setup.py
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>
15 years agoAdd install-html target to makefile
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>
15 years agoAdd install-doc target to makefile
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>
15 years agoFix default install location for manpages
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>
15 years agoRemove variables regarding section 7 man pages
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>
15 years agoFix Makefile to correctly pass prefix option
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>
15 years agoGlobal performance logging
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>
15 years agoLog subprocess calls during performance testing
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>
15 years agoShow full command in subprocess profiling
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>
15 years agoLog subprocess activity to a file
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>
15 years agoAdd some performance testing scripts
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>
15 years agoAdd utility function for reordering patches
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>
15 years agostg goto: Handle hidden patches more gracefully
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>
15 years agoTest operations on hidden patches
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>
15 years agoTeach stgit.lib.transaction about hidden patches
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>
15 years agoLibrary functions for tree and blob manipulation
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>
15 years agoReuse the same temp index in a transaction
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>
15 years agoDo simple in-index merge with diff+apply instead of read-tree
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>
15 years agoDiscard stderr output from git apply if the caller wants
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>
15 years agoFix uncommit status message
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>
15 years agoMake sure that stg uncommit doesn't touch the branch head
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>
15 years agostg uncommit should never touch the branch head
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>
15 years agoTest for exit code with command_error()
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>
15 years agoMerge branch 'stable'
Karl Hasselström [Wed, 23 Jul 2008 21:24:57 +0000 (23:24 +0200)]
Merge branch 'stable'

Conflicts:

setup.py

15 years agoFixed default install location
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>
15 years agoTest that we can add a new file to a non-topmost patch with refresh -p
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>
15 years agosetup.py: fix error message when running with python-2.3
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>
15 years agosetup.py: don't try to import stgit.run before the python version check
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>
15 years agoTest for "stg edit"
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>
15 years agoTest for specific exit code
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>
15 years agoTest "stg status" with -M in stgit.diff-opts
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>
15 years agoMerge branch 'stable'
Karl Hasselström [Tue, 8 Jul 2008 18:24:43 +0000 (20:24 +0200)]
Merge branch 'stable'

Conflicts:

stgit/commands/status.py

15 years agoDon't allow extra diff options with "stg status"
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>
15 years agoTest "stg status" with renames
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>
15 years agoMerge branch 'stable' into stable-master-merge
Karl Hasselström [Sun, 29 Jun 2008 22:47:50 +0000 (00:47 +0200)]
Merge branch 'stable' into stable-master-merge

15 years agoFix "stg sink" with no applied patches (bug 11887)
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>
15 years agoTry "stg sink" without applied patches
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>
15 years agoPatch to allow import from compressed files (gzip and bzip2)
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>
15 years agoFix export error introduced by recent convertion
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>
15 years agoFind CmdException in common
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>
15 years agoFix typo
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>
16 years agoMerge branch 'stable'
Catalin Marinas [Sun, 8 Jun 2008 23:15:21 +0000 (00:15 +0100)]
Merge branch 'stable'

Conflicts:

stgit/version.py

16 years agoRelease 0.14.3 v0.14.3
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>
16 years agoAdd test_patches target to Makefile
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>
16 years agoConvert "init" to the new StGIT infrastructure
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>
16 years agoAdd stack creation and initialisation support to lib.Stack
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>
16 years agoCreate a git.Branch class as ancestor of stack.Stack
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>
16 years agoRename Repository.head to Repository.head_ref
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>
16 years agoAllow stack.patchorder.all to return hidden patches
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>
16 years agoFix the parse_patches() function to work with tuples
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>
16 years agoMerge commit 'kha/safe'
Catalin Marinas [Tue, 3 Jun 2008 21:22:56 +0000 (22:22 +0100)]
Merge commit 'kha/safe'

16 years agoMerge branch 'stable'
Catalin Marinas [Tue, 3 Jun 2008 21:22:45 +0000 (22:22 +0100)]
Merge branch 'stable'

16 years agoSome API documentation for the new infrastructure
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>
16 years agoWrap the text of error messages
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>
16 years agoMerge branch 'stable' into stable-master-merge
Karl Hasselström [Tue, 3 Jun 2008 00:43:24 +0000 (02:43 +0200)]
Merge branch 'stable' into stable-master-merge

16 years agoHandle refresh of changed files with non-ASCII names
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>
16 years agoTest for another filename quoting issue in tree_status()
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>
16 years agoHandle changed files with non-ASCII names
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>
16 years agoAdd rebase test for when upstream has deleted a non-ASCII file
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>
16 years agoConvert "export" to the new infrastructure
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>
16 years agoConvert "top" to the new infrastructure
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>
16 years agoFix error in status.py when calling git.resolved
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>
16 years agoAllow the Repository.get_stack() to get a default argument
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>
16 years agoRewrite the "series" command for the new infrastructure
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>
16 years agoRefactor the Commitdata class to CommitData
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>
16 years agoMerge branch 'stable'
Catalin Marinas [Tue, 27 May 2008 22:18:22 +0000 (23:18 +0100)]
Merge branch 'stable'

Conflicts:

t/t2700-refresh.sh

16 years agoFix "refresh" failure with moved files (bug 11661)
Catalin Marinas [Tue, 27 May 2008 21:47:49 +0000 (22:47 +0100)]
Fix "refresh" failure with moved files (bug 11661)

This patch fixes the git.tree_status() function to not pass missing files
to the git-diff-files command which crashes in weird ways (see the bug
report on gna.org).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd property with a list of all patch names
Karl Hasselström [Tue, 20 May 2008 21:33:25 +0000 (23:33 +0200)]
Add property with a list of all patch names

This simplifies the code in a number of places.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoPrevent most commands from running when there are conflicts
Karl Hasselström [Tue, 20 May 2008 21:33:25 +0000 (23:33 +0200)]
Prevent most commands from running when there are conflicts

When there are conflicts, we want most commands to fail, since the
conflicts conceptually belong to the topmost patch. git read-tree
already checks this for us when we check out a new tree, but there are
operations where the top tree stays the same, e.g. stg new.

This patch inserts a conflict check when the tree to check out is the
same. By default, conflicts will prevent the checkout from succeeding,
but commands can choose to override this if the same patch stays on
top (for some definition of "same").

This change only affects the new-infrastructure commands; the others
always refuse to run when there are local changes of any kind.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: delete patches
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Emacs mode: delete patches

Teach the emacs mode to delete patches. It will delete the selected
patches, or, if no patches are selected, the patch at point (and if
there is no patch at point, complain). Before deleting, it will ask
for confirmation.

Thanks to David Kågedal <davidk@lysator.liu.se> for lots of elisp
help.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoConvert "stg delete" to the new infrastructure
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Convert "stg delete" to the new infrastructure

In the process, it gains the ability to delete any applied patch (not
just the topmost one, like before), even when deleting patches from
another branch. (However, when deleting patches on another branch, we
obviously can't represent a conflict in the index and worktree, so any
conflicts will make the operation abort.)

One of the t1600 subtests made sure that we couldn't delete
non-topmost patches, and had to be corrected.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: use "stg new --file"
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Emacs mode: use "stg new --file"

Creating a new patch is a great deal easier now that "stg new" has a
--file flag.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet "stg new" support more message options
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Let "stg new" support more message options

Let "stg new" support --file and --save-template in addition to
--message. This is useful for scripting.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRefactor --author/--committer options
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Refactor --author/--committer options

This refactoring is specific to the new infrastructure, so only new
and edit use it currently, but other commands can start using it as
they are converted.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoConvert "stg new" to the new infrastructure
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Convert "stg new" to the new infrastructure

This results in considerable code expansion, which is a sure sign that
something needs to be abstracted away -- but to keep things simple,
those transformations come as separate patches.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDisable patchlog test for "stg new"
Karl Hasselström [Tue, 20 May 2008 21:33:24 +0000 (23:33 +0200)]
Disable patchlog test for "stg new"

This will be broken by the "stg new" rewrite, so stop testing it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTry the built-in version string before git-describe
Karl Hasselström [Tue, 20 May 2008 21:33:12 +0000 (23:33 +0200)]
Try the built-in version string before git-describe

Try to get the built-in version string first, and fall back to git
describe if there is no built-in string, instead of the other way
around. This makes computing the version string much cheaper in the
common case (whenever StGit is not run directly from a git-controlled
tree).

In order for this to work when StGit _is_ run directly from a
git-controlled tree, setup.py has to delete the builtin version file
once the installation process is over. (Otherwise, the StGit version
in a git-controlled tree would be frozen at whatever value it happened
to have when setup.py was last run.)

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMerge branch 'stable'
Catalin Marinas [Mon, 19 May 2008 21:56:31 +0000 (22:56 +0100)]
Merge branch 'stable'

16 years agoAllow export to write unapplied files as well
Catalin Marinas [Mon, 19 May 2008 21:54:27 +0000 (22:54 +0100)]
Allow export to write unapplied files as well

This was an artificial limit which upset many people (including me).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoEmacs mode: automatically cd up to root of worktree
Karl Hasselström [Wed, 14 May 2008 00:04:32 +0000 (02:04 +0200)]
Emacs mode: automatically cd up to root of worktree

git's emacs mode automatically finds the root of the worktree, so that
the user doesn't have to. Teach StGit's emacs mode the same trick by
borrowing the git-get-top-dir function from git.

The borrowed code was written by Alexandre Julliard <julliard@winehq.org>.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoBetter StGit version tracking
Karl Hasselström [Tue, 13 May 2008 21:50:31 +0000 (23:50 +0200)]
Better StGit version tracking

Instead of claiming to be the latest released version (really, a
hardcoded string that we hope is the latest released version), run git
describe to figure out what version we are, just like git does. Fall
back to a hardcoded value that is generated at install time, or
supplied in a release tarball.

Currently, we have to give git describe the --tags flag, since StGit
release tags are lightweight tags. This means we're going to pick up
any lightweight tags the user makes, which isn't ideal. The solution
is to start making annotated release tags, and then remove that flag.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoImport version to a separate namespace
Karl Hasselström [Tue, 13 May 2008 21:50:27 +0000 (23:50 +0200)]
Import version to a separate namespace

The set of names we need from the version module is about to get too
large to list explicitly, but we don't want to pollute the local
namespace with every name from version. So do a qualified import of
the module.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove "stg" from start of log messages
Karl Hasselström [Thu, 8 May 2008 22:24:11 +0000 (00:24 +0200)]
Remove "stg" from start of log messages

It's entirely redundant.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUse test_cmp instead of diff -u in the test suite
Karl Hasselström [Sun, 20 Apr 2008 13:17:42 +0000 (15:17 +0200)]
Use test_cmp instead of diff -u in the test suite

Since diff -u isn't available everywhere, and the user might want to
use something else.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoGet rid of backticks in test-lib.sh
Karl Hasselström [Sun, 20 Apr 2008 13:17:42 +0000 (15:17 +0200)]
Get rid of backticks in test-lib.sh

The $(...) notation is just plain nicer.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSteal more test-lib.sh updates from git
Karl Hasselström [Sun, 20 Apr 2008 13:17:41 +0000 (15:17 +0200)]
Steal more test-lib.sh updates from git

This patch incorporates the updates that were made to git's
test-lib.sh from revision v1.2.2-66-g6643688 up to revision
v1.5.5-67-g9a49e00. A few manual adjustments had to be made -- for
example, the StGit tests assume that the repository starts out with an
initial commit, and there's no need to try to get hold of a git binary
other than the one reachable via $PATH. And the test_must_fail helper
function is not that useful to us, since a crashing Python program
won't kill the entire Python interpreter.

The main improvement is that the test script output is now in color!

Shortlog of the imported changes:

  Alex Riesen (2):
        Fix permissions on test scripts
        Do no colorify test output if stdout is not a terminal

  Christian Couder (1):
        Trace into a file or an open fd and refactor tracing code.

  Clemens Buchacher (1):
        http-push: add regression tests

  Eric Wong (3):
        tests: Set EDITOR=: and VISUAL=: globally
        test-lib: quiet down init-db output for tests
        Update tests to use test-chmtime

  Gerrit Pape (1):
        Set $HOME for selftests

  Jeff King (3):
        fix config reading in tests
        use build-time SHELL_PATH in test scripts
        add test_cmp function for test scripts

  Johannes Schindelin (2):
        Introduce GIT_TEMPLATE_DIR
        Make tests independent of global config files

  Johannes Sixt (1):
        test-lib.sh: A command dying due to a signal is an unexpected failure.

  Josh Triplett (1):
        Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL

  Junio C Hamano (26):
        Perl interface: make testsuite work again.
        Perly Git: make sure we do test the freshly built one.
        test-lib: unset GIT_TRACE
        Merge branch 'ml/trace'
        Merge branch 'master' into pb/gitpm
        Deprecate merge-recursive.py
        Merge branch 'jc/gitpm'
        remove merge-recursive-old
        fix testsuite: make sure they use templates freshly built from the source
        Revert "fix testsuite: make sure they use templates freshly built from the source"
        GIT_SKIP_TESTS: allow users to omit tests that are known to break
        t5400 send-pack test: try a bit more nontrivial transfer.
        Fix timestamp for test-tick
        t/test-lib.sh: Protect ourselves from common misconfiguration
        War on whitespace
        Merge branch 'ei/worktree+filter'
        Unset GIT_EDITOR while running tests.
        Sane use of test_expect_failure
        test: reword the final message of tests with known breakages
        tests: introduce test_must_fail
        Merge branch 'cb/http-test'
        tests: introduce test_must_fail
        test-lib: fix TERM to dumb for test repeatability
        Merge branch 'maint'
        Test: catch if trash cannot be removed
        test_must_fail: 129 is a valid error code from usage()

  Martin Waitz (1):
        test-lib: separate individual test better in verbose mode.

  Matthias Lederhofer (1):
        introduce GIT_WORK_TREE to specify the work tree

  Michele Ballabio (2):
        test-lib.sh: move error line after error() declaration
        Fix typo in a comment in t/test-lib.sh

  Nicolas Pitre (1):
        use 'init' instead of 'init-db' for shipped docs and tools

  Petr Baudis (1):
        Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging

  Pierre Habouzit (2):
        Add some fancy colors in the test library when terminal supports it.
        Support a --quiet option in the test-suite.

  Robin Rosenberg (1):
        Quote arguments to tr in test-lib

  Shawn O. Pearce (1):
        Default GIT_MERGE_VERBOSITY to 5 during tests.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUse hardcoded author and committer names in tests
Karl Hasselström [Sun, 20 Apr 2008 13:17:41 +0000 (15:17 +0200)]
Use hardcoded author and committer names in tests

There seems to be no reason for these to stay commented out -- in
fact, commit v0.12-4-g5cd9e87 which introduced these lines seems to
have left them commented out by mistake.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoHandle commandline parsing errors gracefully
Karl Hasselström [Sun, 20 Apr 2008 13:17:17 +0000 (15:17 +0200)]
Handle commandline parsing errors gracefully

The commandline option parser raises SystemExit after having explained
to the user what she did wrong. A recent refactoring introduced a
catch-all "except:" at the top level, which caught the SystemExit and
printed a traceback.

Let's just simply exit instead, like we used to.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMerge branch 'stable'
Catalin Marinas [Thu, 17 Apr 2008 20:50:14 +0000 (21:50 +0100)]
Merge branch 'stable'

16 years agoFix the sync'ing of unapplied patches only
Catalin Marinas [Thu, 17 Apr 2008 20:49:29 +0000 (21:49 +0100)]
Fix the sync'ing of unapplied patches only

When only unapplied patches are to be sync'ed, the command failed
because the first patch was trying to be pushed twice.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>