[KDev4] VCS Integration

Kuba Ober kuba at mareimbrium.org
Thu Mar 15 14:23:12 UTC 2007


On Tuesday 13 March 2007, Andreas Pakulat wrote:
> On 13.03.07 12:58:55, Kuba Ober wrote:
> > On Tuesday 13 March 2007, Andreas Pakulat wrote:
> > > A quick thought brings up the following actions:
> > >
> > > import (into repository)
> > > chechkout
> > > update
> > > commit
> > > diff
> > > log
> >
> > What would all those do? What's an "import"? Is this adding a file to a
> > change? Then checkout -- is it for whole tree, or for a single file? What
> > does an update do?
>
> import == bring a newly created project into a source code repository
aenpr (= aegis -new-project)

> checkout == retrieve a project from a source code repository and import
>             it into kdevelop
aenc (= aegis -new-change)

> update == sync your local copy with the source code repository
aem (= aegis -merge), although it will need to check for branches that were 
integrated in meantime and explicitly merge with those as aegis won't do it 
by itsel, i.e. an update always merges with local branch, and optionally you 
can select which other in-the-meantime-integrated branches you wanna include.

> commit == bring local changes into the source code repository
No such thing in aegis, once you're done with a change you integrate it and 
can start a new one.

> diff == see the difference between your local copy and the latest
>         version in the repository
aed (=aegis -diff)

> log == see a history of changes in the repository.
ael ph (=aegis -list project_history)

> > Aegis, a nice software configuration systen, works on whole trees, i.e.
> > you check out a read-only tree (a change), which has no writable files,
> > and only symlinks, hardlinks/copies or even no links at all to the
> > read-only baseline.
> >
> > In the tree that you checked out you can copy individual files to be
> > read-write, and work on them. Depending on the build tool, you need
> > symlinks, hardlinks/copies, or you may live without links at all.
>
> Sorry, I don't follow you here. Could you give an example session? Or
> have a link to some introductory material?

http://aegis.sf.net is the website.

A sample session would go on like below. This works from scratch, i.e. creates 
a new project, sets everything up, builds and wraips up the change. All 
commands are listed in longhand notation, they all have short aliases (aenp, 
aend, aeni, aenc, etc).

You need to have both aegis and fhist (the preferred diff tool, 
http://fhist.sf.net) installed. Both have the specfiles and rpms available on 
their websites.

#
# create a new project with default branch 1.0 and myself as an administrator
aegis -new_project testproj
#
# equivalent to AEGIS_PROJECT=testproj
ae_p testproj.1.0
#
# I should be able to both develop and integrate changes in this branch
aegis -new_developer `whoami`
aegis -new_integrator `whoami`
aegis -new_reviever `whoami`
#
# Let's break some rules
aegis -project_attributes -file - <<'END'
developer_may_review = true;
developer_may_integrate = true;
reviewer_may_integrate = true;
developers_may_create_changes = false;
umask = 027;
default_test_exemption = false;
default_test_regression_exemption = true;
minimum_change_number = 10;
reuse_change_numbers = true;
minimum_branch_number = 1;
skip_unlucky = false;
compress_database = false;
develop_end_action = goto_being_reviewed;
protect_development_directory = true;
END
#
# create a new change, by default with number 10
# note that if -file is not specified, it will launch vim with a default
# attribute file
cat > foo <<END
/*
** Project "testproj.1.0", Change 10
*/
brief_description = "none";
description = "none";
cause = internal_enhancement;
test_exempt = false;
test_baseline_exempt = true;
regression_test_exempt = true;
architecture =
[
        "unspecified",
];
END
aegis -new_change -P testproj.1.0 -file foo
#
# let's work on branch 1.0, change 10
ae_p testproj.1.0
ae_c 10
#
# start development and go to the change working directory
aegis -develop_begin db 10
aegis -change_directory
# you'll be in ~/testproj.1.0.C010
aegis -new_file aegis.conf
aegis -new_file main.c
aegis -new_file Makefile
#
# sane configuration defaults
cat >aegis.conf <<'END'
patch_diff_command =
        "set +e; "
        "diff -U5 --text -L ${quote $index} -L ${quote $index} "
                "${quote $original} ${quote $input} > ${quote $output}; "
        "test $? -le 1";
build_command = "make";
development_directory_style = {
        source_file_symlink = true;
        derived_file_copy = true;
};
integration_directory_style = {
        source_file_symlink = true;
        derived_file_copy = true;
};
link_integration_directory = true;
history_create_command =
        "fhist ${quote ${basename $input}} -create -cu -i ${quote $input} \
-p ${quote ${dirname $history}} -r";
history_get_command =
        "fhist ${quote ${basename $history}} -e ${quote $e} \
-o ${quote $output} -p ${quote ${dirname $history}}";
history_put_command =
        "fhist ${quote ${basename $input}} -create -cu -i ${quote $input} \
-p ${quote ${dirname $history}} -r";
history_query_command =
        "fhist ${quote ${basename $history}} -l 0 \
-p ${quote ${dirname $history}} -q";
diff_command =
        "[ ${state} = being_developed ] && chmod g+rX `find ${change 
development_directory} -type f`;"
        "fcomp -w ${quote $original} ${quote $input} -o ${quote $output}";
merge_command =
        "fmerge ${quote $original} ${quote $MostRecent} ${quote $input} \
-o ${quote $output} -c /dev/null";
END
#
# some work
cat >main.c <<'END'
#include <stdio.h>
int main(int argc, char ** argv)
{
	printf("Hello, world\n");
	return 0;
}
END
cat >Makefile <<'END'
test: main.o
        gcc -o test main.o
main.o:
        gcc -c main.c
END
#
# a test
aegis -new_test
cat >test/00/t0001a.sh <<'END'
[ "`./main`" = "Hello, world" ]
END
#
# wrap it up, dude
aegis -build
aegis -test
aegis -diff
aegis -develop_end
#
# now the change is up for review, manually review the diffs
aedless
aegis -review_pass
#
# integrate the change
cd ~
aegis -integrate_begin
aegis -build
aegis -diff
aegis -test
aegis -integrate_pass
#
# done!
aegis -list changes
# Change  State           Description
# ------- -------         -------------
#   10    completed       none

That's about it.

Cheers, Kuba




More information about the KDevelop-devel mailing list