~jfb-tempo-consulting/unifield-wm/sync-env-py3

« back to all changes in this revision

Viewing changes to scripts/common.py

  • Committer: jf
  • Date: 2022-02-01 10:24:52 UTC
  • mfrom: (173.1.1 sync-env)
  • Revision ID: jfb@tempo-consulting.fr-20220201102452-rndr3uvmo030kqlf
[MERGE] US-9423: instance registration: do not validate an instance with no group on the sync server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from sys import stdout, stderr, exit
2
2
 
3
 
from xmlrpc.client import Fault
 
3
from xmlrpclib import Fault
4
4
import openerplib103 as openerplib
5
5
 
6
6
from tests.openerplib import db
7
7
 
8
8
import config
9
9
import os
10
 
import breezy.bzr
11
 
from breezy.workingtree import WorkingTree
12
 
from breezy.branch import Branch
13
 
#from bzrlib.workingtree import WorkingTree
14
 
#from bzrlib.branch import BzrBranch
 
10
from bzrlib.workingtree import WorkingTree
 
11
from bzrlib.branch import BzrBranch
15
12
 
16
13
 
17
14
__all__ = ['server', 'client', 'db_instance', 'Synchro', 'HQ', 'Coordo', 'Project', 'Project2', 'check_lp_update', 'get_revno_from_path']
136
133
)
137
134
 
138
135
def get_lp_branch(wk):
139
 
    if isinstance(wk.branch, Branch):
 
136
    if isinstance(wk.branch, BzrBranch):
140
137
        parent = wk.branch.get_parent()
141
138
        if parent is None:
142
139
            parent = wk.branch.get_bound_location()
162
159
        src_path = os.path.join(config.source_path, ad)
163
160
        info = get_revno_from_path(src_path)
164
161
 
165
 
        br = Branch.open(info['lpurl'])
 
162
        br = BzrBranch.open(info['lpurl'])
166
163
        lr = br.last_revision()
167
164
        revno = br.revision_id_to_dotted_revno(lr)[0]
168
165