Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ed3b0977
Commit
ed3b0977
authored
Jun 12, 2017
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wb revision, pwg-files added auatomatically, and doc
parent
1b1e0251
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
250 additions
and
10 deletions
+250
-10
src/doc/man/en_us/man_dg.dat
src/doc/man/en_us/man_dg.dat
+60
-6
src/doc/man/src/dg_fig124.png
src/doc/man/src/dg_fig124.png
+0
-0
src/doc/man/src/dg_fig125.png
src/doc/man/src/dg_fig125.png
+0
-0
src/doc/man/src/dg_fig126.png
src/doc/man/src/dg_fig126.png
+0
-0
src/doc/man/sv_se/man_dg.dat
src/doc/man/sv_se/man_dg.dat
+62
-0
wb/lib/wb/src/wb_build.cpp
wb/lib/wb/src/wb_build.cpp
+6
-0
wb/lib/wb/src/wb_revision.cpp
wb/lib/wb/src/wb_revision.cpp
+112
-2
wb/lib/wb/src/wb_revision.h
wb/lib/wb/src/wb_revision.h
+5
-1
xtt/lib/ge/src/ge.cpp
xtt/lib/ge/src/ge.cpp
+5
-1
No files found.
src/doc/man/en_us/man_dg.dat
View file @
ed3b0977
...
...
@@ -8463,23 +8463,77 @@ the same development environment. A project points at a Proview base, e.g. V3.4,
when creating a project you have to choose which base the project should point at.
<h2>Path
The project consists of a directory tree where databases, source files, archives etc are
stored.
The path is the root directory of this tree.
The project consists of a directory tree where databases, source files, archives etc are
stored.
The path is the root directory of this tree.
</topic>
</chapter>
<chapter>
<topic> revisions
Revisions
<h1>Revisions window
Revisions are handled from the Revisions window. It's opened from the menu in the configurator,
File/Revisions.
A revision is a state in the development environment that is stored in a version control
system. The revision should include all source files to make it possible to restore a revision.
A revision can be used to review the state when the revision was created, and also to build
runable systems from the restored source to test or run aa restore revision in production.
The currently supported version control system is Git. A new repository will be created on
$pwrp_root/src when the first revision is created.
<h1>Revision window
Revisions are handled from the Revision window that is opened from the File menu in the
configurator.
<h1>Create a revision
A new revision is created from Functions/New Revison in the menu. New revisions can only be
created if the currently checkedout revision is the end point of a branch.
<image>dg_fig124.png
<b>Fig Create a new revision
<h1>Restore a revision
A revision is restored from Functions/Restore in the menu. Select the revision to restore
first.
<image>dg_fig125.png
<b>Fig Restore a revision
When a revision is restored the checked out revision is marked with a radio button in the list.
Also in the configurator title bar, the current revision is written.
<image>dg_fig126.png
<b>Fig An old revision is restored
<h1>Create a branch
If on old revision in the main line is restored, a branch can be created by creating a new
revision from this point. In the figure above, a branch has be created from revision V2.0.1.
New revisions can also be created from the end point of the branch. In the figure above, a
new revision can be created from V2.0.1-2 that is an end point, but not from V2.0.1-1.
<h1>New files
New files, e.g. c-applications, are not automatically added to the git repository.
This has to be done manually. New files are displayed by Git as untracked files in the
'git status' command. Untracked files can be added with the 'git add' command and will then
be included in the next revision.
Note! It's important to add new files to be able to restore a complete revision.
<b>Example
<c>> git status
<c>On branch B_V2.0.5
<c>Untracked files:
<c> (use "git add <file>..." to include in what will be committed)
<c> appl/ra_appl.c
<c>> git add appl/ra_appl.c
</topic>
</chapter>
<chapter>
<topic> dg_tools
Verktyg
Tools
pwrc <t>Command interface to development database. <link> dg_pwrc
wb_ge <t>Ge editor <link> wb_ge
...
...
src/doc/man/src/dg_fig124.png
0 → 100644
View file @
ed3b0977
54.8 KB
src/doc/man/src/dg_fig125.png
0 → 100644
View file @
ed3b0977
47.8 KB
src/doc/man/src/dg_fig126.png
0 → 100644
View file @
ed3b0977
34.7 KB
src/doc/man/sv_se/man_dg.dat
View file @
ed3b0977
...
...
@@ -8352,6 +8352,68 @@ Path
</topic>
</chapter>
<chapter>
<topic> revisions
Revisioner
En revision är ett tillstånd i utvecklingsmiljön som lagras i ett versionskontrollsystem.
Revisionen ska innehålla alla källkodsfiler så att det är möjligt att återskapa en revision.
En revision kan användas för att visa det tillstånd som rådde när revisionen skapades, men
också för att bygga körbara system från den återskapade koden för test eller för att köra
revisionen in produktion.
Det versionskontrollsystem som supportas för närvarande är Git. Ett nytt repository skapas
på katalogen $pwrp_root/src när det första revisionen skapas.
<h1>Revisionsfönstret
Revisioner hanteras från revisionsfönstret som öppnas från File menyn i konfiguratorn.
<h1>Skapa en revision
En ny revision skapas från Functions/New Revision i menyn. Nya revisioner kan endast skapas
om den utcheckade revisionen är en ändpunkt på en gren.
<image>dg_fig124.png
<b>Fig Skapa en ny revision
<h1>Återskapa en revision
En revision återskapas från Functions/Restore i menyn. Välj ut den revision som ska återskapas
först.
<image>dg_fig125.png
<b>Fig Återskapa en revision
Utcheckad revision markeras med en radioknapp i listan. Även i konfiguratorns titel anges
den utcheckade revisionen.
<image>dg_fig126.png
<b>Fig En revision återskapas
<h1>Skapa en gren
Om en gammal revision i huvudlinjen återskapas, kan en gren skapas genom att skapa en ny
revision från denna punkt. I figuren ovan har en gren skapats från revision V2.0.1. Nya
revisioner kan även skapas från ändpunkter av grenar. I figuren ovan, kan en ny revision
skapas frän V2.0.1-2, som är en ändpunkt, men inte från V2.0.1-1.
<h1>Nya filer
Nya filer, t ex c-applikationer, adderas inte automatiskt till git-repositoryt. Detta måste
göras manuellt. Nya filer visas av Git som 'untracked files' med 'git status' kommandot.
Untracked files kan adderas med 'git add' kommandot och kommer sedan att inkluderas i
nästa revision.
OBS! Det är viktigt att addera nya filer för att kunna återskapa en komplett revision.
<b>Exampel
<c>> git status
<c>On branch B_V2.0.5
<c>Untracked files:
<c> (use "git add <file>..." to include in what will be committed)
<c> appl/ra_appl.c
<c>> git add appl/ra_appl.c
</topic>
</chapter>
<chapter>
<topic> dg_tools
Verktyg
...
...
wb/lib/wb/src/wb_build.cpp
View file @
ed3b0977
...
...
@@ -54,6 +54,7 @@
#include "wb_merep.h"
#include "wb_log.h"
#include "wb_dblock.h"
#include "wb_revision.h"
#include "glow.h"
#include "glow_growctx.h"
...
...
@@ -1073,6 +1074,8 @@ void wb_build::xttgraph( pwr_tOid oid)
strcpy
(
name
,
action
);
if
((
s
=
strrchr
(
name
,
'.'
)))
*
s
=
0
;
wb_revision
::
check_add_file
(
src_fname
);
wb_log
::
log
(
wlog_eCategory_GeBuild
,
name
,
0
);
m_sts
=
PWRB__SUCCESS
;
}
...
...
@@ -1328,6 +1331,8 @@ void wb_build::webgraph( pwr_tOid oid)
strcpy
(
name
,
graph_name
);
if
((
s
=
strrchr
(
name
,
'.'
)))
*
s
=
0
;
wb_revision
::
check_add_file
(
src_fname
);
wb_log
::
log
(
wlog_eCategory_GeBuild
,
name
,
0
);
m_sts
=
PWRB__SUCCESS
;
}
...
...
@@ -1418,6 +1423,7 @@ void wb_build::appgraph( pwr_tOid oid)
strcpy
(
name
,
graph_name
);
if
((
s
=
strrchr
(
name
,
'.'
)))
*
s
=
0
;
wb_revision
::
check_add_file
(
src_fname
);
wb_log
::
log
(
wlog_eCategory_GeBuild
,
name
,
0
);
m_sts
=
PWRB__SUCCESS
;
}
...
...
wb/lib/wb/src/wb_revision.cpp
View file @
ed3b0977
...
...
@@ -53,8 +53,6 @@ wb_revision::wb_revision( void *parent_ctx, wb_session *ses):
{
char
current
[
80
];
m_manager
=
new
wb_version_manager_git
();
read_file
();
switch
(
m_manager_enum
)
{
...
...
@@ -97,6 +95,20 @@ wb_revision::wb_revision( void *parent_ctx, wb_session *ses):
}
}
wb_revision
::
wb_revision
()
:
m_parent_ctx
(
0
),
m_session
(
0
),
m_manager
(
0
),
m_manager_enum
(
pwr_eVersionManagerEnum_None
),
m_read
(
false
),
m_current_idx
(
-
1
),
m_current_main_idx
(
-
1
),
m_current_sub_idx
(
-
1
),
m_command_cb
(
0
)
{
read_file_meta
();
switch
(
m_manager_enum
)
{
case
pwr_eVersionManagerEnum_Git
:
m_manager
=
new
wb_version_manager_git
();
break
;
default:
;
}
}
char
*
wb_revision
::
branch_name
(
char
*
name
)
{
static
char
bname
[
80
];
...
...
@@ -541,6 +553,40 @@ void wb_revision::read_file()
m_read
=
true
;
}
void
wb_revision
::
read_file_meta
()
{
pwr_tFileName
fname
;
char
line
[
200
];
char
item_array
[
6
][
80
];
dcli_translate_filename
(
fname
,
"$pwrp_db/pwrp_cnf_revision.dat"
);
ifstream
fp
(
fname
,
ios
::
in
);
if
(
!
fp
)
{
m_read
=
true
;
return
;
}
while
(
fp
.
getline
(
line
,
sizeof
(
line
)))
{
wb_rev_item
item
;
int
nr
;
nr
=
dcli_parse
(
line
,
" "
,
""
,
(
char
*
)
item_array
,
sizeof
(
item_array
)
/
sizeof
(
item_array
[
0
]),
sizeof
(
item_array
[
0
]),
0
);
if
(
nr
==
3
&&
strcmp
(
item_array
[
0
],
"#!"
)
==
0
&&
strcmp
(
item_array
[
1
],
"RevisionManager"
)
==
0
)
{
if
(
strcmp
(
item_array
[
2
],
"1"
)
==
0
)
m_manager_enum
=
pwr_eVersionManagerEnum_Git
;
else
m_manager_enum
=
pwr_eVersionManagerEnum_None
;
continue
;
}
if
(
strcmp
(
item_array
[
0
],
"#!"
)
!=
0
)
break
;
}
fp
.
close
();
}
void
wb_revision
::
write_file
()
{
pwr_tFileName
fname
;
...
...
@@ -713,6 +759,14 @@ void wb_revision::next_name( char *name)
strcpy
(
name
,
""
);
}
int
wb_revision
::
check_add_file
(
char
*
filename
)
{
wb_revision
rev
;
if
(
rev
.
m_manager
)
return
rev
.
m_manager
->
check_add
(
filename
);
return
0
;
}
void
wb_version_manager_git
::
init
()
{
pwr_tFileName
fname
;
...
...
@@ -925,3 +979,59 @@ int wb_version_manager_git::check( vector<wb_rev_item>& v)
return
REV__SUCCESS
;
}
int
wb_version_manager_git
::
check_add
(
char
*
filename
)
{
pwr_tCmd
cmd
;
pwr_tFileName
fname
,
f2name
;
char
*
s
,
*
s1
=
0
;
pwr_tFileName
rname
=
"$pwrp_tmp/gitresult.tmp"
;
char
line
[
200
];
int
sts
;
dcli_translate_filename
(
rname
,
rname
);
dcli_translate_filename
(
f2name
,
filename
);
int
cnt
=
0
;
bool
found
=
false
;
for
(
s
=
&
f2name
[
strlen
(
f2name
)
-
1
];
s
!=
f2name
;
s
--
)
{
if
(
*
s
==
'/'
)
{
cnt
++
;
if
(
cnt
==
2
)
{
strncpy
(
fname
,
s
+
1
,
sizeof
(
fname
));
found
=
true
;
break
;
}
else
s1
=
s
;
}
}
if
(
!
found
&&
s1
)
strncpy
(
fname
,
s1
+
1
,
sizeof
(
fname
));
else
if
(
!
found
)
strncpy
(
fname
,
filename
,
sizeof
(
fname
));
sprintf
(
cmd
,
"cd $pwrp_root/src; git ls-files -o --exclude-standard | grep %s$ > %s"
,
fname
,
rname
);
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
return
0
;
ifstream
fp
(
rname
);
fp
.
getline
(
line
,
sizeof
(
line
));
fp
.
close
();
dcli_trim
(
line
,
line
);
if
(
strcmp
(
line
,
""
)
==
0
)
return
0
;
sprintf
(
cmd
,
"cd $pwrp_root/src; git add %s"
,
line
);
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Git error %d
\n
"
,
sts
);
sprintf
(
cmd
,
"rm -f %s"
,
rname
);
system
(
cmd
);
return
1
;
}
wb/lib/wb/src/wb_revision.h
View file @
ed3b0977
...
...
@@ -85,7 +85,7 @@ class wb_version_manager
virtual
int
restore_revision
(
char
*
name
,
char
*
branch
,
int
checkout_master
,
int
checkout_branch
)
{
return
0
;}
virtual
int
get_current
(
char
*
name
)
{
return
0
;}
virtual
int
check
(
vector
<
wb_rev_item
>&
v
)
{
return
0
;}
virtual
int
check_add
(
char
*
filename
)
{
return
0
;}
};
class
wb_version_manager_git
:
public
wb_version_manager
...
...
@@ -98,6 +98,7 @@ class wb_version_manager_git : public wb_version_manager
int
restore_revision
(
char
*
name
,
char
*
branch
,
int
checkout_master
,
int
checkout_branch
);
int
get_current
(
char
*
name
);
int
check
(
vector
<
wb_rev_item
>&
v
);
int
check_add
(
char
*
filename
);
};
class
wb_revision
:
public
wb_status
...
...
@@ -115,6 +116,7 @@ class wb_revision : public wb_status
int
(
*
m_command_cb
)(
void
*
ctx
,
char
*
cmd
);
public:
wb_revision
();
wb_revision
(
void
*
parent_ctx
,
wb_session
*
ses
);
~
wb_revision
()
{
if
(
m_manager
)
...
...
@@ -126,6 +128,7 @@ class wb_revision : public wb_status
pwr_tStatus
build_all
();
pwr_tStatus
remove
(
char
*
name
);
void
read_file
();
void
read_file_meta
();
void
write_file
();
int
add
(
char
*
name
,
char
*
description
,
char
*
version
,
pwr_tTime
*
date
,
bool
in_main
,
int
sub_idx
);
void
list
();
...
...
@@ -142,6 +145,7 @@ class wb_revision : public wb_status
static
char
*
branch_name
(
char
*
name
);
static
void
info
(
wb_rev_info
*
info
);
static
int
check_add_file
(
char
*
filename
);
};
#endif
...
...
xtt/lib/ge/src/ge.cpp
View file @
ed3b0977
...
...
@@ -79,7 +79,7 @@
#include "wb_wnav_selformat.h"
#include "wb_nav.h"
#include "wb_log.h"
#include "wb_revision.h"
void
Ge
::
set_title
()
{
...
...
@@ -1205,6 +1205,7 @@ void Ge::activate_build()
{
char
name
[
40
];
pwr_tCmd
cmd
;
pwr_tFileName
fname
;
graph
->
get_name
(
name
);
if
(
strcmp
(
name
,
""
)
==
0
||
graph
->
is_modified
())
{
...
...
@@ -1215,6 +1216,9 @@ void Ge::activate_build()
sprintf
(
cmd
,
"cp -a $pwrp_pop/%s.pwg $pwrp_exe/"
,
name
);
system
(
cmd
);
sprintf
(
fname
,
"$pwrp_pop/%s.pwg"
,
name
);
wb_revision
::
check_add_file
(
fname
);
message
(
'I'
,
"Graph built"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment