summaryrefslogtreecommitdiff
path: root/gbp
AgeCommit message (Collapse)Author
2013-04-13Add minimal vfs interfaceGuido Günther
so we can access blobs in git as file like objects
2013-04-13Use _git_inout for git.showGuido Günther
so we don't spew the error message on stdout for nonexistent objects
2013-04-08Revert "GitRepository.show: use _git_inout()"Guido Günther
This changes the newline behaviour. readlines() as used by _git_getoutput correctly keeps the newlines while this change doesn't. This reverts commit 92edb4eda14cf4b5fd1514feb7b81aa50456285c.
2013-04-07GitRepository.show: use _git_inout()Markus Lehtonen
Instead of the deprecated _git_getoutput() method. Also, capture stderr and put the error message to the exception, instead. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-06Add urgency management.Daniel Dehennin
* tests/11_test_dch_main.py: test the new --urgency option to dch.main(). Add only meaningful tests, i.e. options alone and combined with --release and --snapshot. * git-dch (fixup_section): Manage "urgency" option. (main): Add version_group option "-U" and "--urgency" to set the urgency level of the entry. * docs/manpages/git-dch.sgml: Update documentation for new option.
2013-04-06Add option to manage distribution fields for non snapshot mode.Daniel Dehennin
The snapshot mode fails to merge two "debian/changelog" entries if the distribution is not "UNRELEASED". * tests/11_test_dch_main.py: test the new --distribution option to dch.main(). Add only meaningful tests, i.e. options alone and combined with --release and --snapshot. * git-dch (fixup_section): Rename as it's used to fix header in addition to trailer, this require a new named parameter "options". (main): Add version_group option "-D" and "--distribution" to specify the distribution name. Add version_group option "--force-distribution" to force the provided distribution to be used, used by "dch". Rename fixup_trailer() to fixup_section() and add options as parameters. * docs/manpages/git-dch.sgml: Update documentation for new options. Closes: #646684
2013-03-29Move DscFile to separate moduleGuido Günther
2013-03-29Move DebianPkgPolicy to separate moduleGuido Günther
2013-03-29Move debian/changelog manipulation to gbp.deb.changelog.ChangeLog.Daniel Dehennin
spawn_dch switch gbp.command.wrappers.Command. * gbp/deb/changelog.py (ChangeLog.spawn_dch): static method adapted from gbp.scripts.dch and converted to gbp.command_wrappers.Command. (add_entry): New method adapted from gbp.scripts.dch.add_changelog_entry. (add_section): New method adapted from gbp.scripts.dch.add_changelog_entry. Remove DebianGitRepository and options, this has nothing to do with changelog management. * tests/test_Changelog.py: Test new methods. * gbp/scripts/dch.py: Remove useless functions: system(), spawn_dch(), add_changelog_section() and add_changelog_entry(). Update calls accordingly. (fixup_trailer): Use spawn_dch() method of ChangeLog class. (process_options): dch_options became a list. (main): Use add_section() and add_entry() methods of ChangeLog object. Take care of upstream version since ChangeLog.add_section() does not manage it anymore. Update exception handling, ChangeLog.spawn_dch() can raise "CommandExecFailed" exception. Closes: #672954
2013-03-29Include the name of the package being built in the debian tag messageDaniel Kahn Gillmor
Currently, the message in the debian tag is just: "Debian release %s" % cp.version This is a bad idea, because it means that the signed message itself contains no mention of the project that is being worked on. Since all git repositories are conceptually the same git repository (some just have commits that others don't have), a malicious attacker could inject tags from project A into the repository for project B and the original developer's signature on those tags would be intact. This is potentially a security problem. For example: if there are automated build systems that pull from a repo and verify signed tags made by a known developer (and that developer contributes to multiple projects), this conflation could be used to make those systems build packages from an entirely other project. The attached patch enforces the inclusion of the name of the package into the tag's message. Closes: #704018
2013-03-27Fix docstringGuido Günther
2013-03-27Split out building a debian version from an upstream commitGuido Günther
based on a patch by Daniel Dehennin Needed for #672954, #646684, #669171
2013-03-22GitArgs: utilize the add() method in other add_X methodsMarkus Lehtonen
Only use the add() method for updating the argument list. This makes the code more robust and makes all add method variant types support the same argument types. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22GitRepository/_cmd_has_feature: more intelligent parsingMarkus Lehtonen
More intelligent parsing of the git output (man page). Try to parse optional options like '--[no-]standard-notes' of git-show correctly. In this example both 'no-standard-notes' and 'standard-notes' would be available. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22gbp-pull: update tags, tooMarkus Lehtonen
To make sure that the tags are in sync with the remote. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22Purging of the build dir should be configurable via a config fileGuido Günther
so introdice --git[-no]-purge which is consistent with the other boolean options and deprecate --git-dont-purge. Closes: #702200
2013-03-22Allow for upper case characters in the upstream versionGuido Günther
Closes: #703694
2013-03-22Better document how one derives from PkgTypesGuido Günther
2013-03-22Return boolean types from is_ methodsGuido Günther
instead of a match object or None
2013-03-22Remove unused importsGuido Günther
2013-01-17gbp-pull: fix --depth cmdline optionMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-17gbp-clone: fix return value in case of GitRepositoryErrorMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-16pq/apply_and_commit_patch: fix date parsingMarkus Lehtonen
GitModifier doesn't support dates in the format used in git format-patch emails. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-16buildpackage: add 'force' option to write_wc()Markus Lehtonen
To select whether to include file that would otherwise be ignored by gitignore (.gitignore or .git/info/exclude). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-16pq: do author guessing outside the apply_patch functionsMarkus Lehtonen
Call the author parsing/guessing function outside the apply patch functions. This way, the caller can decide when to do the guessing, and with which parameters. Now the apply_patch functions do what their name suggests. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-16log: make color setting a tristate on/off/autoMarkus Lehtonen
Makes it possible to force color=on e.g. when piping output. Also, moves all 'auto' logic to one single place, i.e. the streamhandler. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-27Tristate: drop broken and unused is_valid_state() methodMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-27Tristate: allow to init from another Tristate objectMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-27Check the sha1 doesn't exceed 40 bytesGuido Günther
2012-11-27GitRepository/strip_sha1: fix length checkingMarkus Lehtonen
Accept longer sha1 than what was asked for. The length option given to git is merely a "wish to get a sha1 of this length". Git may also return longer sha1 if truncating to given length would give ambiguous/non-unique sha1. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-25git-dch: Allow to create changelogs when not on a branchGuido Günther
This makes snapshot changelog generation e.g. within jenkins builds simpler since jenkins by defaults checkouts out the commit without creating a branch.
2012-11-25gbp-create-remote-repo: Set HEAD in remote repoGuido Günther
to debian branch Closes: #692006
2012-11-25gbp.log: Improve error message on broken color listsGuido Günther
2012-11-25New configuration option for setting the output color schemeMarkus Lehtonen
Adds a new command line and config file option 'color-scheme' for selecting the colors used in log output. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-25log: add support for setting the color schemeMarkus Lehtonen
Implements changeable color schemes in the gbp.log module. Color scheme is given as a colon-separated list, with one color for each log level: '<debug_color>:<info_color>:<warning_colro>:<error_color>'. Colors can be given as an integer number (ANSI terminal color code) or color name (.e.g 'red'). Missing or empty fields are interpreted as using the default color for that log level. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-25gbp.log: lowercase the levelnameGuido Günther
too match the output before the switch to Python's logging module
2012-11-25log: rewrite the module to use Python logging moduleMarkus Lehtonen
Replaces the Logger with a new one, derived from the Logger class of the Python standard library. Colorized output is handled by a separate handler class. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-25gbp-pq: Improve patch header write outGuido Günther
Avoid trailing new lines in the patch header when reexporing patches. to avoid diffs when nothing changed.
2012-11-24git-import-dscs: Properly catch import errorsGuido Günther
Closes: #694113
2012-11-24Remove unused imports and adjust formattingGuido Günther
Git-Dch: Ignore
2012-11-24gbp-pq: don't use plural form when there's only one try leftGuido Günther
2012-11-24GitRepository/has_submodules: use correct .gitmodules fileMarkus Lehtonen
Examine .gitmodules from the "root directory" of the repo, not the current working directory. Fixes has_submodules() method, when called from arbitrary cwd. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-24GitRepository/get_commit_info: support tagsMarkus Lehtonen
Dereference the given revision to a commit. Fixes get_commit_info() when called for a tag. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_submodules: use correct pathMarkus Lehtonen
By default, run git in the repo path, not current cwd. Also, now returns submodule paths without leading './'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_commits: more flexible revision rangesMarkus Lehtonen
Support getting the complete history of an arbitrary commit-ish (since=None, until=COMMIT-ISH). Formerly this was only possible for the current git HEAD. Now, get_commits(since=None, until='COMMIT') translates to 'git log COMMIT'. Also, for consistency, add support for getting the history from an arbitrary commit until the current HEAD (since=COMMIT-ISH, until=None). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23import-orig: remove dead GbpNothingImported exceptionMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23import-orig: remove dead if statementMarkus Lehtonen
GitRepository.commit_dir() never returns empty objects. It raises an exception, instead. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23Add sha1 stripping in a single placeGuido Günther
so we can easily sanity check the result.
2012-11-23pq: Allow to pass in custom fucntion to fetch authorship informationGuido Günther
so the RPM based tools don't need to rely on a control file but can e.g. look at the spec file.
2012-11-23Use an absolute path when parsing the control fileGuido Günther
so we con't accidentally parse a file from another dir.