Code Duplication    Length = 23-24 lines in 2 locations

doorstop/core/vcs/veracity.py 1 location

@@ 11-34 (lines=24) @@
8
log = common.logger(__name__)
9
10
11
class WorkingCopy(BaseWorkingCopy):
12
    """Veracity working copy."""
13
14
    DIRECTORY = '.sgdrawer'
15
    IGNORES = ('.sgignores', '.vvignores')
16
17
    def lock(self, path):
18
        log.debug("`vv` does not support scripted locking: %s", path)
19
        self.call('vv', 'pull')
20
        self.call('vv', 'update')
21
22
    def edit(self, path):
23
        log.info("`vv` adds all changes")
24
25
    def add(self, path):
26
        self.call('vv', 'add', path)
27
28
    def delete(self, path):
29
        self.call('vv', 'remove', path)
30
31
    def commit(self, message=None):
32
        message = message or input("Commit message: ")
33
        self.call('vv', 'commit', '--message', message)
34
        self.call('vv', 'push')
35

doorstop/core/vcs/mercurial.py 1 location

@@ 11-33 (lines=23) @@
8
log = common.logger(__name__)
9
10
11
class WorkingCopy(BaseWorkingCopy):
12
    """Mercurial working copy."""
13
14
    DIRECTORY = '.hg'
15
    IGNORES = ('.hgignore',)
16
17
    def lock(self, path):
18
        log.debug("`hg` does not support locking: {}".format(path))
19
        self.call('hg', 'pull', '-u')
20
21
    def edit(self, path):
22
        self.call('hg', 'add', path)
23
24
    def add(self, path):
25
        self.call('hg', 'add', path)
26
27
    def delete(self, path):
28
        self.call('hg', 'remove', path, '--force')
29
30
    def commit(self, message=None):
31
        message = message or input("Commit message: ")
32
        self.call('hg', 'commit', '--message', message)
33
        self.call('hg', 'push')
34