Skip to content

Commit

Permalink
Merge pull request #12053 from oljemark/remove2old
Browse files Browse the repository at this point in the history
Remove functions unused since 2016, see #6928
  • Loading branch information
amaltaro authored Jul 22, 2024
2 parents e0916c1 + 82cafe3 commit 3fae2bb
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/python/WMCore/Database/CMSCouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,30 +338,6 @@ def document(self, id, rev=None):
uri += '?' + urllib.parse.urlencode({'rev': rev})
return Document(id=id, inputDict=self.get(uri))

def getPrevisousRevision(self, doc_id, numberBefore=1):
"""
:param: doc_id, couch document id
:param: numberBefore: previous revision, 1 means one previous revision, 2 means 2 doucments eariler.
special case 0 means the first revision.
:return: previous revision document specified by numberBefore
"""
uri = '/%s/%s?revs=true&open_revs=all' % (self.name, urllib.parse.quote_plus(doc_id))
revisionRecord = self.get(uri)
rev = revisionRecord[0]['ok']['_revisions']

if numberBefore == 0:
revNum = 1
revID = rev['start'] - 1
else:
revNum = rev['start'] - numberBefore
revID = rev['ids'][numberBefore]
preRev = "%s-%s" % (revNum, revID)

if doc_id != revisionRecord[0]['ok']['_id']:
raise CouchError("revision record doesn match", revisionRecord[0]['ok']['_id'], doc_id)

return self.document(doc_id, preRev)

def updateDocument(self, doc_id, design, update_func, fields=None, useBody=False):
"""
Call the update function update_func defined in the design document
Expand Down Expand Up @@ -942,10 +918,6 @@ def archived_dbs(self):
"""
return [doc['value'] for doc in self._find_dbs_in_state('archived')]

def non_rotating_commit(self):
# might need this after all....
pass

def makeRequest(self, uri=None, data=None, type='GET', incoming_headers=None,
encode=True, decode=True, contentType=None,
cache=False, rotate=True):
Expand Down

0 comments on commit 3fae2bb

Please sign in to comment.